{"id":102840,"date":"2020-05-11T04:49:29","date_gmt":"2020-05-10T20:49:29","guid":{"rendered":"http:\/\/4563.org\/?p=102840"},"modified":"2020-05-11T04:49:29","modified_gmt":"2020-05-10T20:49:29","slug":"%e6%9c%80%e8%bf%91-typescript-%e8%b6%8a%e6%9d%a5%e8%b6%8a%e7%81%ab%ef%bc%8c%e9%82%a3%e4%b9%88%e9%80%89%e6%8b%a9%e5%ae%83%e7%9a%84%e7%90%86%e7%94%b1%e6%98%af%e4%bb%80%e4%b9%88%e5%91%a2%ef%bc%9f","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=102840","title":{"rendered":"\u6700\u8fd1 TypeScript \u8d8a\u6765\u8d8a\u706b\uff0c\u90a3\u4e48\u9009\u62e9\u5b83\u7684\u7406\u7531\u662f\u4ec0\u4e48\u5462\uff1f"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u6700\u8fd1 TypeScript \u8d8a\u6765\u8d8a\u706b\uff0c\u90a3\u4e48\u9009\u62e9\u5b83\u7684\u7406\u7531\u662f\u4ec0\u4e48\u5462\uff1f               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : npm <\/span>  <span><i><\/i> 50<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>TypeScript \u6700\u7ec8\u4f1a\u88ab\u7f16\u8bd1\u6210 JavaScript\uff0c\u90a3\u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5\u5199 JavaScript \u5462\uff1f\uff1f<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>23<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"696019\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : npm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8981\u5b66\u7684\u4e1c\u897f\u8d8a\u6765\u8d8a\u591a\uff0c\u611f\u89c9\u90fd\u5feb\u5b66\u4e0d\u8fc7\u6765\u4e86\u3002<\/p>\n<p>\u5728\u60f3\u8981\u4e0d\u8981\u5b66 TypeScript                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696020\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : tonytonychopper <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7f16\u7a0b\u8bed\u8a00\u4f1a\u53d8\u6210 01 \u4ee3\u7801\uff0c\u90a3\u4e3a\u4ec0\u4e48\u4e0d\u76f4\u63a5\u5199 01 \u5462\uff1f\u591a\u770b\u770b TypeScript \u5e26\u6765\u4e86\u4ec0\u4e48\uff0c\u624d\u77e5\u9053\u8981\u4e0d\u8981\u5b66\u5b83\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696021\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : varzy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u5b58\u5728\u5373\u5408\u7406\uff0c\u80fd\u706b\u8d77\u6765\u5fc5\u7136\u6709\u5176\u9053\u7406\u3002\u6211\u4e2a\u4eba\u8ba4\u4e3a ts \u6700\u5927\u7684\u4f5c\u7528\u5c31\u662f\u8ba9\u4f60\u77e5\u9053 . \u7684\u540e\u9762\u6709\u4ec0\u4e48\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696022\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wd <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u589e\u52a0 type \u4e3b\u8981\u662f\u4e3a\u4e86\u534f\u4f5c\u4ee5\u53ca\u8ba9\u4ee3\u7801\u66f4\u597d\u7ef4\u62a4\u3002\u4f60\u60f3\u60f3\u6709\u4e00\u4e2a\u65b9\u6cd5\u534a\u5e74\u540e\u4f60\u60f3\u91cd\u6784\u4e0b\uff0c\u6709 type \u548c\u6ca1 type \u7684\u533a\u522b\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696023\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : HeyWeGo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528 ts \u66f4\u591a\u7684\u662f\u5de5\u7a0b\u4e0a\u7684\u8003\u8651                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696024\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DOLLOR <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             TS \u7684\u6210\u529f\uff0c\u4e0d\u5728\u4e8e\u5b83\u5e26\u6765\u4e86\u4ec0\u4e48\uff0c\u5728\u4e8e\u5b83\u6ca1\u6709\u5984\u56fe\u9769 JS \u7684\u547d\u3002TS \u53f7\u79f0 JS \u7684\u4e00\u4e2a\u8d85\u96c6\uff0cJS \u6709\u7684 TS \u90fd\u6709\uff0cJS \u80fd\u505a\u7684 TS \u90fd\u80fd\uff0cJS \u66f4\u65b0\u5219 TS \u4e5f\u4e00\u8d77\u8ddf\u8fdb\u3002<br \/>\u76f8\u6bd4\u4e4b\u4e0b\uff0cRuby \u90a3\u5e2e\u4eba\u641e\u7684 CoffeeScript\uff0c\u4e14\u4e0d\u8bf4\u628a JS \u7684\u8bed\u6cd5\u5168\u6253\u6389\uff0c\u6211\u4e0d\u592a\u660e\u767d\u8fd9\u4e2a\u8bed\u8a00\u5c45\u7136\u7981\u6b62 variable shadowing\uff0c\u4f7f\u5f97\u5b83\u96be\u4ee5\u7528\u5728\u591a\u4eba\u534f\u540c\u7684\u5927\u9879\u76ee\u4e2d\u3002\u5e76\u4e14\u968f\u7740 ES6 \u7684\u53d1\u5e03\uff0c\u8ddf\u4e0d\u4e0a JS \u7684\u65b0\u7279\u6027\uff0c\u5f88\u5feb\u88ab\u6e6e\u6ca1\u5728\u5386\u53f2\u7684\u957f\u6d41\u4e2d\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696025\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : shunfy <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             js \u6709\u4e86 es6, \u8fd8\u9700\u8981 ts \u8fdb\u884c\u52a0\u6301?                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696026\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cmdOptionKana <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e00\u4e2a\u81ea\u5df1\u4e0d\u641e\u5927\u9879\u76ee\u7684\u666e\u901a\u7a0b\u5e8f\u5458\uff0c\u5b66 TS \u7684\u4e3b\u8981\u7406\u7531\u5c31\u662f\u8d8a\u6765\u8d8a\u591a\u516c\u53f8\u7528\u5b83\u3002<\/p>\n<p>\u800c\u516c\u53f8\u7528\u5b83\u7684\u7406\u7531\u5c31\u662f\u7c7b\u578b\u5b89\u5168\uff0c\u51cf\u5c11\u4f4e\u7ea7 bug \u7684\u51fa\u73b0\uff0c\u66f4\u5bb9\u6613\u91cd\u6784\uff0c\u4ece Java \u7b49\u8bed\u8a00\u8f6c\u8fc7\u6765\u5bb9\u6613\u3002<\/p>\n<p>\u5982\u679c\u4e00\u4e2a\u81ea\u5df1\u4e0d\u641e\u5927\u9879\u76ee\u7684\u666e\u901a\u7a0b\u5e8f\u5458\uff0c\u4e0d\u8003\u8651\u627e\u5de5\u4f5c\u7684\u95ee\u9898\uff0c\u53ea\u8003\u8651\u5728\u81ea\u5df1\u7684\u5c0f\u9879\u76ee\u91cc\u7528\u4ec0\u4e48\u8bed\u8a00\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b TS \u4f18\u52bf\u4e0d\u660e\u663e\u3002                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696027\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : gdrk <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u66f4\u5229\u4e8e\u5de5\u7a0b\u5316\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696028\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : optional <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u6709\u56e2\u961f\u5f00\u53d1\u7ecf\u5386\u5c31\u53ef\u4ee5\u9886\u7565\u5230 ts \u5e95\u9b45\u529b                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696029\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Torpedo <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u517c\u5bb9 js \u826f\u597d\u3002\u53ef\u4ee5\u589e\u52a0\u7c7b\u578b\u6765\u9650\u5236\u4e00\u4e0b\u5927\u5bb6                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696030\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : DFshpAq3 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @wd \u60a8\u597d\uff0c\u4e0d\u592a\u660e\u767d\u91cd\u6784\u65f6\u6709 type \u548c\u6ca1 type \u7684\u533a\u522b\uff0c\u65b9\u4fbf\u6307\u6559\u4e00\u4e0b\u5417                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696031\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : scofieldpeng <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @DFshpAq3 #12 \u8fd9\u4e2a\u5f88\u7b80\u5355\uff0c\u6bd4\u5982\u4f60\u91cd\u6784\u7684\u65f6\u5019\uff0c\u770b\u5230\u4e00\u4e2a\u51fd\u6570\uff0c\u6709\u63a5\u6536\u53c2\u6570\uff0c\u4f46\u662f\u4f60\u77e5\u9053\u8fd9\u4e2a\u53c2\u6570\u63a5\u6536\u7684\u662f\u4ec0\u4e48\u7c7b\u578b\u4e48\uff1f int \uff1f float \uff1f array \uff1f object \uff1f\u6216\u8005\u662f\u67d0\u4e00\u4e2a\u5177\u4f53\u7684\u7c7b\uff1f\u6216\u8005\u8fd4\u56de\u503c\u662f\u5565\u4f60\u77e5\u9053\u4e48\uff1f\u4f60\u8fd9\u4e9b\u4e0d\u77e5\u9053\uff0c\u4f60\u9664\u975e\u628a\u6574\u4e2a\u7cfb\u7edf\u91cd\u5934\u64b8\u5230\u5c3e\uff0c\u786e\u5b9a 100%\u77e5\u9053\u4f60\u5230\u5e95\u8981\u6539\u5565\u7684\u65f6\u5019\u4f60\u91cd\u6784\u7684\u65f6\u5019\u624d\u4e0d\u4f1a\u6f0f\u6389\u539f\u6765\u7684\u903b\u8f91\uff0c\u907f\u514d\u8d8a\u91cd\u6784\u8d8a\u5783\u573e\u7684\u95ee\u9898\uff0c\u5f53\u7136\uff0c\u8fd9\u53ea\u662f\u4f60\u91cd\u6784\uff0c\u4f60\u53bb\u7ef4\u62a4\u8fed\u4ee3\u4e5f\u662f\u540c\u6837\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696032\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : wxsm <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u9879\u76ee\u5927\u4e86\uff0c\u4eba\u591a\u4e86\uff0cjs \u5199\u51fa\u6765\u7684\u4e1c\u897f\u8fdf\u65e9\u4f1a\u53d8\u6210\u4e00\u5768                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696033\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : uxstone <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7c7b\u578b\u5373\u6ce8\u91ca                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696034\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : iRiven <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7c7b\u578b\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696035\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : Vegetable <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ts \u7b26\u5408\u524d\u7aef\u5927\u52bf&#8211;\u5de5\u7a0b\u5316.                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696036\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : agdhole <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7c7b \u578b \u5b89 \u5168                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696037\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hc181533609 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u8bf4\u592a\u591a \u4e5f\u6ca1\u4ec0\u4e48\u7528\uff0c\u5f88\u591a\u5199\u540e\u53f0\u7684\u4eba\u6bd4\u8f83\u4e60\u60ef\u8fd9\u79cd\u5199\u6cd5\uff0c\u8fd9\u6837\u4ed6\u4eec\u4f7f\u7528 js \u6210\u672c\u66f4\u4f4e\uff0c\u81f3\u4e8e\u5de5\u7a0b\u5316 \u7ef4\u62a4\u6027\uff0c\u8fd9\u4e9b\u524d\u671f\u67b6\u6784\u597d\u5b9a\u597d\u52a0\u4e0a review\uff0c\u540e\u671f\u81ea\u7136\u5dee\u4e0d\u4e86\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696038\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : HongJay <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7c7b\u4f3c\u4e8e kotlin \u4e4b\u4e8e java \uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696039\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : hc181533609 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u81f3\u4e8e\u7c7b\u578b\u5b89\u5168 \u4e4b\u524d \u4e5f\u6709 flow \u5176\u4ed6 \u4e5f\u4e0d\u592a\u61c2 \u6211\u7684\u4e86\u89e3 \u5927\u6982 \u5c31\u8fd9\u4e9b\u5427                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696040\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : cheneydog <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             FaceBook \u51fa\u4e86\u4e2a \u53eb Reason \u7684\u8bed\u8a00\uff0c\u5bf9\u6807 Typescript\uff0c\u4f53\u9a8c\u4e86\u4e0b\u611f\u89c9\u8fd8\u884c\u3002                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"696041\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mwVYYA6 <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             ts \u5199\u6210\u72d7\u5c4e\u7684\u4e5f\u4e0d\u5c11\u5440\uff0c\u95ee\u9898\u6839\u672c\u4e0d\u5728\u4e8e\u6709\u6ca1\u6709\u7c7b\u578b\u68c0\u67e5\uff0c\u800c\u662f\u4e09\u5c42\u4e09\u5143\u8868\u8fbe\u5f0f\uff0cn \u4e2a\u5faa\u73af\u5d4c\u5957\u8fd9\u79cd\u4ee4\u4eba\u53d1\u72c2\u7684\u4ee3\u7801\u3002\u8fd9\u79cd\u4ee3\u7801\u4e0d\u7ba1\u7528 xx \u8bed\u8a00\u90fd\u662f\u72d7\u5c4e\u3002<br \/>ts \u4ec5\u4ec5\u52a0\u4e86\u4e2a\u7c7b\u578b\u68c0\u67e5\u800c\u5df2\uff0c\u4e24\u5c42\u5d4c\u5957\u540e\u7c7b\u578b\u8fd8\u627e\u4e0d\u5230\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u6700\u8fd1 TypeScript \u8d8a\u6765\u8d8a&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/102840"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=102840"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/102840\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=102840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=102840"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=102840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}