{"id":4842,"date":"2023-01-05T10:46:20","date_gmt":"2023-01-05T02:46:20","guid":{"rendered":"https:\/\/badgameshow.com\/steven\/?p=4842"},"modified":"2023-01-05T10:46:20","modified_gmt":"2023-01-05T02:46:20","slug":"%e4%ba%86%e8%a7%a3typescript%e7%a8%8b%e5%bc%8f%e8%aa%9e%e8%a8%80%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8b%95%e6%8e%a8%e6%96%ad%e5%8a%9f%e8%83%bd","status":"publish","type":"post","link":"https:\/\/badgameshow.com\/steven\/typescript\/%e4%ba%86%e8%a7%a3typescript%e7%a8%8b%e5%bc%8f%e8%aa%9e%e8%a8%80%e4%b8%ad%e7%9a%84%e8%87%aa%e5%8b%95%e6%8e%a8%e6%96%ad%e5%8a%9f%e8%83%bd\/","title":{"rendered":"\u4e86\u89e3TypeScript\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u7684\u81ea\u52d5\u63a8\u65ad\u529f\u80fd"},"content":{"rendered":"<p><meta name=\"keywords\" content=\"TypeScript, TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad, Type Auto-Inference\"><\/p>\n<h1>\u4ec0\u9ebc\u662f TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\uff1f<\/h1>\n<p>TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\uff08Type Auto-Inference\uff09\u662f\u4e00\u7a2e\u6280\u8853\uff0c\u5b83\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u5728\u4e0d\u6307\u5b9a\u8b8a\u91cf\u985e\u578b\u7684\u60c5\u6cc1\u4e0b\uff0c\u8b93 TypeScript \u81ea\u52d5\u63a8\u65ad\u51fa\u8b8a\u91cf\u7684\u985e\u578b\u3002\u9019\u7a2e\u6280\u8853\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u52a0\u9748\u6d3b\u5730\u4f7f\u7528 TypeScript\uff0c\u4e26\u4e14\u53ef\u4ee5\u6e1b\u5c11\u958b\u767c\u8005\u5728\u7a0b\u5f0f\u78bc\u4e2d\u6307\u5b9a\u8b8a\u91cf\u985e\u578b\u7684\u6642\u9593\u3002<\/p>\n<h2>TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\u7684\u512a\u9ede<\/h2>\n<p>TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\u7684\u512a\u9ede\u6709\u5f88\u591a\uff0c\u5176\u4e2d\u6700\u91cd\u8981\u7684\u662f\u53ef\u4ee5\u6e1b\u5c11\u958b\u767c\u8005\u5728\u7a0b\u5f0f\u78bc\u4e2d\u6307\u5b9a\u8b8a\u91cf\u985e\u578b\u7684\u6642\u9593\uff0c\u4e26\u4e14\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u52a0\u9748\u6d3b\u5730\u4f7f\u7528 TypeScript\u3002<\/p>\n<p>\u53e6\u5916\uff0cTypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\u4e5f\u53ef\u4ee5\u6e1b\u5c11\u7a0b\u5f0f\u78bc\u7684\u8907\u96dc\u5ea6\uff0c\u56e0\u70ba\u958b\u767c\u8005\u4e0d\u9700\u8981\u6307\u5b9a\u8b8a\u91cf\u7684\u985e\u578b\uff0c\u4e5f\u4e0d\u9700\u8981\u6307\u5b9a\u51fd\u6578\u7684\u53c3\u6578\u985e\u578b\uff0c\u9019\u6a23\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u78bc\u66f4\u52a0\u7c21\u6f54\u3002<\/p>\n<h2>TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\u7684\u793a\u4f8b<\/h2>\n<p>\u4e0b\u9762\u662f\u4e00\u500b\u4f7f\u7528 TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\u7684\u793a\u4f8b\uff1a<\/p>\n<pre class=\"brush: typescript\">\n\/\/ \u4e0d\u6307\u5b9a\u8b8a\u91cf\u985e\u578b\nlet myVariable = \"Hello World\";\n\n\/\/ TypeScript \u6703\u81ea\u52d5\u63a8\u65ad\u51fa myVariable \u7684\u985e\u578b\u70ba string\nconsole.log(typeof myVariable); \/\/ string\n<\/pre>\n<p>\u5728\u4e0a\u9762\u7684\u793a\u4f8b\u4e2d\uff0c\u6211\u5011\u6c92\u6709\u6307\u5b9a\u8b8a\u91cf myVariable \u7684\u985e\u578b\uff0c\u4f46\u662f TypeScript \u4ecd\u7136\u53ef\u4ee5\u81ea\u52d5\u63a8\u65ad\u51fa myVariable \u7684\u985e\u578b\u70ba string\u3002<\/p>\n<h2>\u7e3d\u7d50<\/h2>\n<p>TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\uff08Type Auto-Inference\uff09\u662f\u4e00\u7a2e\u6280\u8853\uff0c\u5b83\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u5728\u4e0d\u6307\u5b9a\u8b8a\u91cf\u985e\u578b\u7684\u60c5\u6cc1\u4e0b\uff0c\u8b93 TypeScript \u81ea\u52d5\u63a8\u65ad\u51fa\u8b8a\u91cf\u7684\u985e\u578b\u3002TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\u7684\u512a\u9ede\u6709\u5f88\u591a\uff0c\u5176\u4e2d\u6700\u91cd\u8981\u7684\u662f\u53ef\u4ee5\u6e1b\u5c11\u958b\u767c\u8005\u5728\u7a0b\u5f0f\u78bc\u4e2d\u6307\u5b9a\u8b8a\u91cf\u985e\u578b\u7684\u6642\u9593\uff0c\u4e26\u4e14\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u52a0\u9748\u6d3b\u5730\u4f7f\u7528 TypeScript\u3002<!--more-->TypeScript \u7c7b\u578b\u81ea\u52a8\u63a8\u65ad\u4e5f\u53ef\u4ee5\u6e1b\u5c11\u7a0b\u5f0f\u78bc\u7684\u8907\u96dc\u5ea6\uff0c\u56e0\u70ba\u958b\u767c\u8005\u4e0d\u9700\u8981\u6307\u5b9a\u8b8a\u91cf\u7684\u985e\u578b\uff0c\u4e5f\u4e0d\u9700\u8981\u6307\u5b9a\u51fd\u6578\u7684\u53c3\u6578\u985e\u578b\uff0c\u9019\u6a23\u53ef\u4ee5\u8b93\u7a0b\u5f0f\u78bc\u66f4\u52a0\u7c21\u6f54\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6458\u8981:TypeScript\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u7684\u81ea\u52d5\u63a8\u65ad\u529f\u80fd\u53ef\u4ee5\u8b93\u958b\u767c\u8005\u66f4\u5feb\u901f\u5730\u5b8c\u6210\u7a0b\u5f0f\u78bc\uff0c\u672c\u6587\u5c07\u4ecb\u7d39TypeScript\u7a0b\u5f0f\u8a9e\u8a00\u4e2d\u7684\u81ea\u52d5\u63a8\u65ad\u529f\u80fd\uff0c\u4ee5\u53ca\u5982\u4f55\u4f7f\u7528\u5b83\u4f86\u63d0\u9ad8\u958b\u767c\u6548\u7387\u3002<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[187],"tags":[186],"class_list":["post-4842","post","type-post","status-publish","format-standard","hentry","category-typescript","tag-typescript"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_shortlink":"https:\/\/wp.me\/pcFK27-1g6","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/4842","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/comments?post=4842"}],"version-history":[{"count":1,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/4842\/revisions"}],"predecessor-version":[{"id":4843,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/posts\/4842\/revisions\/4843"}],"wp:attachment":[{"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/media?parent=4842"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/categories?post=4842"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/badgameshow.com\/steven\/wp-json\/wp\/v2\/tags?post=4842"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}