{"id":1363,"date":"2024-06-02T22:24:11","date_gmt":"2024-06-02T22:24:11","guid":{"rendered":""},"modified":"2024-06-05T03:09:46","modified_gmt":"2024-06-04T19:09:46","slug":"underscore-%e7%9a%84%e6%ba%90%e7%a0%81%e8%af%a5%e5%a6%82%e4%bd%95%e9%98%85%e8%af%bb%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.lccc.top\/?p=1363","title":{"rendered":"underscore \u7684\u6e90\u7801\u8be5\u5982\u4f55\u9605\u8bfb\uff1f"},"content":{"rendered":"<td class=\"d-block comment-body markdown-body  js-comment-body\">\n<h2 dir=\"auto\">\u524d\u8a00<\/h2>\n<p dir=\"auto\">\u522b\u540d\uff1a\u300aunderscore \u7cfb\u5217 8 \u7bc7\u6b63\u5f0f\u5b8c\u7ed3\uff01\u300b<\/p>\n<h2 dir=\"auto\">\u4ecb\u7ecd<\/h2>\n<p dir=\"auto\">underscore \u7cfb\u5217\u662f\u6211\u5199\u7684\u7b2c\u4e09\u4e2a\u7cfb\u5217\uff0c\u524d\u4e24\u4e2a\u7cfb\u5217\u5206\u522b\u662f <a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/17\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/17\/hovercard\">JavaScript \u6df1\u5165\u7cfb\u5217<\/a>\u3001<a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/53\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/53\/hovercard\">JavaScript \u4e13\u9898\u7cfb\u5217<\/a>\u3002<\/p>\n<p dir=\"auto\">\u8fd9\u4e2a\u7cfb\u5217\u7b97\u662f JavaScript \u4e13\u9898\u7cfb\u5217\u7684\u756a\u5916\u7bc7\uff0c\u603b\u5171\u5199\u4e86 8 \u7bc7\uff0c\u91cd\u70b9\u4ecb\u7ecd\u4e86 underscore \u4e2d\u7684\u4ee3\u7801\u7ec4\u7ec7\u3001\u94fe\u5f0f\u8c03\u7528\u3001\u5185\u90e8\u51fd\u6570\u3001\u6a21\u677f\u5f15\u64ce\u3001\u5de5\u5177\u51fd\u6570\u7b49\u5185\u5bb9\uff0c\u65e8\u5728\u5e2e\u52a9\u5927\u5bb6\u9605\u8bfb\u6e90\u7801\uff0c\u4ee5\u53ca\u5199\u51fa\u81ea\u5df1\u7684 undercore\u3002<\/p>\n<p dir=\"auto\">\u987a\u4fbf\u5ba3\u4f20\u4e00\u4e0b\u8be5\u535a\u5ba2\u7684 Github \u4ed3\u5e93\uff1a<a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\">https:\/\/github.com\/mqyqingfeng\/Blog<\/a>\uff0c\u6b22\u8fce star\uff0c\u9f13\u52b1\u4e00\u4e0b\u4f5c\u8005\u3002<\/p>\n<h2 dir=\"auto\">\u8d77\u56e0<\/h2>\n<p dir=\"auto\">\u60f3\u5148\u804a\u804a\u4e3a\u4ec0\u4e48\u4f1a\u5199 underscore \u7cfb\u5217\uff1f<\/p>\n<p dir=\"auto\">\u6700\u4e00\u5f00\u59cb\u5199 JavaScript \u4e13\u9898\u7cfb\u5217\u7684\u65f6\u5019\uff0c\u56e0\u4e3a\u6d89\u53ca\u5230\u53bb\u91cd\u3001\u6241\u5e73\u7b49\u529f\u80fd\u70b9\u7684\u5b9e\u73b0\uff0c\u6240\u4ee5\u5c31\u7814\u7a76\u4e86 underscore \u4e2d\u7684\u5b9e\u73b0\u65b9\u5f0f\uff0c\u540e\u6765\u5199\u5b8c\u4e13\u9898\u7cfb\u5217\uff0c\u6709\u670b\u53cb\u5c31\u95ee\u6211\u8be5\u5982\u4f55\u7ec4\u7ec7\u8fd9\u4e9b\u529f\u80fd\u51fd\u6570\u5462\uff1f<\/p>\n<p dir=\"auto\">\u8bf4\u8d77\u6765\uff0c\u6211\u4e5f\u6709\u8fd9\u6837\u7684\u56f0\u60d1\uff0c\u56e0\u4e3a\u4ee5\u524d\u5728\u6280\u672f\u5e73\u53f0\u4e0a\u4e5f\u770b\u5230\u8fc7\u4e00\u4e9b\u5206\u4eab\u81ea\u5df1\u5e38\u7528\u529f\u80fd\u51fd\u6570\u7684\u6587\u7ae0\uff0c\u6bcf\u5f53\u8fd9\u4e2a\u65f6\u5019\uff0c\u603b\u4f1a\u5e7b\u60f3\u5982\u679c\u6709\u7bc7\u6587\u7ae0\u80fd\u8bb2\u8bb2\u8be5\u5982\u4f55\u7ec4\u7ec7\u4ee3\u7801\uff0c\u7136\u540e\u6211\u5b66\u4f1a\u540e\uff0c\u5728\u4e1a\u52a1\u4e2d\u4e0d\u65ad\u603b\u7ed3\u5b8c\u5584\uff0c\u6216\u8bb8\u6211\u4e5f\u80fd\u5199\u51fa\u81ea\u5df1\u7684\u5de5\u5177\u51fd\u6570\u5e93\u3002<\/p>\n<p dir=\"auto\">\u4e34\u6e0a\u7fa1\u9c7c\uff0c\u4e0d\u5982\u9000\u800c\u7ed3\u7f51\uff0c\u6240\u4ee5\u6211\u60f3\u7814\u7a76\u4e0b underscore \u7684\u4ee3\u7801\u662f\u5982\u4f55\u7ec4\u7ec7\u7684\uff0c\u540e\u6765\u53c8\u89c9\u5f97\u53cd\u6b63\u90fd\u770b\u4e86\u4e00\u904d\uff0c\u518d\u8fdb\u4e00\u6b65\uff0c\u8bb2\u8bb2 underscore \u7684\u6e90\u7801\u5427\u3002<\/p>\n<p dir=\"auto\">\u4e0d\u8fc7\uff0c\u8fd9\u4e2a\u7cfb\u5217\u7684\u5185\u5bb9\u8ddf\u4e00\u822c\u8bb2\u89e3 underscore \u6e90\u7801\u7684\u7cfb\u5217\u6587\u7ae0\u8fd8\u662f\u6709\u5f88\u5927\u7684\u4e0d\u540c\uff0c\u4e3b\u8981\u5728\u4e8e\u5b83\u8bb2\u7684\u7b97\u662f\u5f88&#8221;\u8fb9\u7f18&#8221;\u7684\u5185\u5bb9\uff0c\u4ece\u6587\u7ae0\u7684\u6807\u9898\u4e2d\u4e5f\u53ef\u4ee5\u770b\u51fa\uff0c\u8bb2\u5b8c\u4ee3\u7801\u7ed3\u6784\u540e\uff0c\u8bb2\u4e86\u5185\u90e8\u51fd\u6570\u3001\u6a21\u677f\u5f15\u64ce\uff0c\u5de5\u5177\u51fd\u6570\u7b49\u8fd9\u4e9b\u5e76\u4e0d\u662f\u5728\u5b9e\u9645\u5f00\u53d1\u4e2d\u5e38\u7528\u5230\u7684 API\uff0c\u5373\u4fbf\u662f\u5728\u5176\u4ed6\u7684\u7cfb\u5217\u6587\u7ae0\u4e2d\uff0c\u8fd9\u4e9b\u4e5f\u7b97\u662f\u5f88\u51b7\u95e8\u7684\u5185\u5bb9\uff0c\u4e0d\u8fc7\u8fd9\u4e5f\u6b63\u597d\u5370\u8bc1\u4e86\u6211\u5199 underscore \u7cfb\u5217\u7684\u76ee\u7684\uff0c\u5c31\u662f\u5e2e\u52a9\u5927\u5bb6\u66f4\u597d\u7684\u9605\u8bfb\u6e90\u7801\u3002<\/p>\n<p dir=\"auto\">\u6240\u4ee5\u5b83\u4e0e\u5176\u4ed6 underscore \u7cfb\u5217\u7684\u6587\u7ae0\u5e76\u4e0d\u51b2\u7a81\uff0c\u5b8c\u5168\u53ef\u4ee5\u5728\u9605\u8bfb\u5b8c\u8fd9\u4e2a\u7cfb\u5217\u540e\uff0c\u518d\u8ddf\u7740\u5176\u4ed6\u7cfb\u5217\u7684\u6587\u7ae0\u63a5\u7740\u5b66\u4e60\u3002<\/p>\n<h2 dir=\"auto\">\u5982\u4f55\u9605\u8bfb<\/h2>\n<p dir=\"auto\">\u6211\u5728\u5199 underscore \u7cfb\u5217\u7684\u65f6\u5019\uff0c\u88ab\u95ee\u7684\u6700\u591a\u7684\u95ee\u9898\u5c31\u662f\u8be5\u600e\u4e48\u9605\u8bfb underscore \u6e90\u7801\uff1f\u6211\u60f3\u7b80\u5355\u804a\u4e00\u4e0b\u81ea\u5df1\u7684\u601d\u8def\u3002<\/p>\n<p dir=\"auto\">\u9996\u5148\uff0cunderscore \u7684\u5b9a\u4f4d\u662f\u4e00\u4e2a\u529f\u80fd\u51fd\u6570\u5e93\uff0c\u63d0\u4f9b\u4e86 110 \u591a\u4e2a API \u5e2e\u52a9\u5f00\u53d1\uff0c\u6240\u4ee5\u9996\u5148\u8981\u641e\u660e\u767d\u7684\u5c31\u662f\u90a3\u4e48\u591a\u7684\u51fd\u6570\uff0c\u662f\u5982\u4f55\u7ec4\u7ec7\u7684\uff1f\u662f\u5982\u4f55\u505a\u5230\u65e2\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\uff0c\u53c8\u80fd\u4ee5\u9762\u5411\u5bf9\u8c61\u7684\u65b9\u5f0f\u4f7f\u7528\u7684\uff1f\u53c8\u662f\u5982\u4f55\u5b9e\u73b0\u94fe\u5f0f\u8c03\u7528\u7684\uff1f\u4e86\u89e3\u4e86\u5982\u4f55\u7ec4\u7ec7\u4ee3\u7801\uff0c\u751a\u81f3\u4ece\u4e2d\u62bd\u79bb\u5f97\u5230\u4e00\u4e2a\u6a21\u677f\uff0c\u6211\u4eec\u518d\u4ece\u4e1a\u52a1\u4e2d\u6162\u6162\u603b\u7ed3\uff0c\u6700\u7ec8\u4e5f\u80fd\u5199\u51fa\u81ea\u5df1\u7684 underscore\u3002<\/p>\n<p dir=\"auto\">\u63a5\u4e0b\u6765\u662f\u9605\u8bfb\u5185\u90e8\u51fd\u6570\uff0c\u5176\u5b9e\u4e0d\u591a\uff0c\u53ea\u6709 cb\u3001optimizeCb\u3001restArgs\u3001shallowProperty\u3001deepGet \u800c\u5df2\uff0c\u4e4b\u6240\u4ee5\u9605\u8bfb\u8fd9\u4e9b\u51fd\u6570\u7684\u5b9e\u73b0\uff0c\u662f\u56e0\u4e3a\u5728\u8bfb\u5176\u4ed6 API \u65f6\u5f88\u53ef\u80fd\u4f1a\u63a5\u89e6\u5230\u8fd9\u4e9b\u51fd\u6570\uff0c\u6211\u7b2c\u4e00\u6b21\u5728\u5176\u4ed6 API \u4e2d\u770b\u5230 cb\u3001optimizeCb\u3001restArgs \u51fd\u6570\u65f6\u90fd\u662f\u4e00\u8138\u61f5\u903c\uff0c\u63a5\u7740\u770b API \u5427\uff0c\u603b\u89c9\u5f97\u8fd9\u70b9\u6ca1\u770b\u61c2\uff0c\u5fc3\u91cc\u4e00\u76f4\u5f88\u4e0d\u723d\uff0c\u8f6c\u800c\u53bb\u770b\u8fd9\u4e9b\u51fd\u6570\u7684\u5b9e\u73b0\uff0c\u53c8\u56e0\u4e3a\u53ea\u8bfb\u4e86\u4e00\u70b9\u6e90\u7801\uff0c\u60f3\u4e0d\u660e\u767d\u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u62bd\u8c61\uff0c\u8fdb\u9000\u4e24\u96be\uff0c\u6162\u6162\u7684\u5c31\u4ea7\u751f\u4e86\u632b\u8d25\u611f\uff0c\u8fd9\u4e5f\u5c31\u662f\u6211\u4e3a\u4ec0\u4e48\u4f1a\u4e13\u95e8\u5199\u4e86\u4e24\u7bc7\u4ecb\u7ecd\u5185\u90e8\u51fd\u6570\uff0c\u4e0d\u4ec5\u4ec5\u662f\u8bb2\u89e3\u6e90\u7801\uff0c\u66f4\u91cd\u8981\u7684\u662f\u5e0c\u671b\u5927\u5bb6\u660e\u767d\u4e3a\u4ec0\u4e48\u8981\u8fd9\u4e48\u62bd\u8c61\u3002<\/p>\n<p dir=\"auto\">\u6700\u540e\u5c31\u662f\u8ddf\u7740\u5174\u8da3\u5b66\u4e60\uff0cunderscore API \u4f17\u591a\uff0c\u4e00\u4e2a\u4e00\u4e2a\u770b\u5b9e\u5728\u662f\u6d88\u78e8\u70ed\u60c5\uff0c\u5012\u4e0d\u5982\u4f60\u60f3\u4e86\u89e3\u54ea\u4e2a\u529f\u80fd\u5c31\u53bb\u7814\u7a76\u54ea\u4e2a\u529f\u80fd\u7684\u5b9e\u73b0\uff0c\u5982\u679c\u8bf4\u5728\u8fd9\u90e8\u5206\u6709\u4ec0\u4e48\u5efa\u8bae\u7684\u8bdd\uff0c\u90a3\u5c31\u662f\u5728\u7814\u7a76\u4e00\u4e9b\u51fd\u6570\u5177\u4f53\u7684\u5b9e\u73b0\u65b9\u5f0f\u65f6\uff0c\u53ef\u4ee5\u53c2\u8003\u4e00\u4e9b\u5df2\u7ecf\u5199\u8fc7\u7684\u6e90\u7801\u5206\u6790\u7684\u6587\u7ae0\uff0c\u4e5f\u8bb8\u4e8b\u534a\u529f\u500d\uff1a<\/p>\n<ol dir=\"auto\">\n<li><a href=\"https:\/\/www.gitbook.com\/book\/yoyoyohamapi\/undersercore-analysis\/details\" rel=\"nofollow\">\u5434\u6653\u519b\u6e90\u7801\u5206\u6790\u7cfb\u5217<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/hanzichi\/underscore-analysis\">\u97e9\u5b50\u8fdf\u6e90\u7801\u5206\u6790\u7cfb\u5217<\/a><\/li>\n<\/ol>\n<p dir=\"auto\">\u5f53\u7136\u5566\uff0c\u5373\u4fbf\u5982\u6b64\uff0c\u9605\u8bfb\u6e90\u7801\u7684\u8fc7\u7a0b\u4e5f\u5e76\u4e0d\u662f\u4e00\u5e06\u98ce\u987a\uff0c\u603b\u4f1a\u56e0\u4e3a\u5404\u79cd\u539f\u56e0\uff0c\u653e\u5f03\u53c8\u91cd\u65b0\u62fe\u8d77\uff0c\u53c8\u653e\u5f03\u53c8\u91cd\u65b0\u62fe\u8d77\uff0c\u5f88\u6b63\u5e38\uff0c\u6211\u4e5f\u6ca1\u6709\u4ec0\u4e48\u597d\u7684\u65b9\u6cd5\uff0c\u53ea\u80fd\u8bf4\u4fdd\u6301\u4e00\u4e2a\u5e73\u548c\u7684\u5fc3\u6001\u5c31\u662f\u4e00\u79cd\u8fdb\u6b65\u3002<\/p>\n<h2 dir=\"auto\">\u5168\u76ee\u5f55<\/h2>\n<ol dir=\"auto\">\n<li><a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/56\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/56\/hovercard\">underscore \u7cfb\u5217\u4e4b\u5982\u4f55\u5199\u81ea\u5df1\u7684 underscore<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/57\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/57\/hovercard\">underscore \u7cfb\u5217\u4e4b\u94fe\u5f0f\u8c03\u7528<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/58\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/58\/hovercard\">underscore \u7cfb\u5217\u4e4b\u5185\u90e8\u51fd\u6570 cb \u548c optimizeCb<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/60\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/60\/hovercard\">underscore \u7cfb\u5217\u4e4b\u5185\u90e8\u51fd\u6570 restArgs<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/62\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/62\/hovercard\">underscore \u7cfb\u5217\u4e4b\u9632\u51b2\u7a81\u4e0e Utility Functions<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/63\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/63\/hovercard\">underscore \u7cfb\u5217\u4e4b\u5b9e\u73b0\u4e00\u4e2a\u6a21\u677f\u5f15\u64ce(\u4e0a)<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/70\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/70\/hovercard\">underscore \u7cfb\u5217\u4e4b\u5b9e\u73b0\u4e00\u4e2a\u6a21\u677f\u5f15\u64ce(\u4e0b)<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/77\" data-hovercard-type=\"issue\" data-hovercard-url=\"\/mqyqingfeng\/Blog\/issues\/77\/hovercard\">underscore \u7cfb\u5217\u4e4b\u5b57\u7b26\u5b9e\u4f53\u4e0e _.escape<\/a><\/li>\n<\/ol>\n<h2 dir=\"auto\">\u4e0b\u671f\u9884\u544a<\/h2>\n<p dir=\"auto\">\u6309\u7167\u539f\u5b9a\u7684\u8ba1\u5212\uff0c\u662f\u51c6\u5907\u5199 ES6 \u7cfb\u5217\u7684\uff0c\u4e0d\u8fc7\uff0c\u56e0\u4e3a\u5de5\u4f5c\u7684\u539f\u56e0\uff0c\u5f88\u53ef\u80fd\u4f1a\u5148\u5199 React \u7cfb\u5217\uff0c\u6682\u65f6\u8fd8\u4e0d\u80fd\u786e\u5b9a\uff0c\u4eca\u5e74\u53ea\u5e0c\u671b\u80fd\u5199\u5b8c\u6700\u540e\u4e24\u4e2a\u7cfb\u5217\u3002<\/p>\n<p dir=\"auto\">\u611f\u8c22\u5927\u5bb6\u7684\u9605\u8bfb\u548c\u652f\u6301\uff0c\u6211\u662f\u51b4\u7fbd\uff0c\u4e0b\u4e2a\u7cfb\u5217\u518d\u89c1\u5566\uff01[]~(\uffe3\u25bd\uffe3)~**<\/p>\n<\/td>\n<p>\u6587\u7ae0\u8f6c\u8f7d\u81ea<a href='https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/79'>https:\/\/github.com\/mqyqingfeng\/Blog\/issues\/79<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u8a00 \u522b\u540d\uff1a\u300aunderscore \u7cfb\u5217 8 \u7bc7\u6b63\u5f0f\u5b8c\u7ed3\uff01\u300b \u4ecb\u7ecd underscore \u7cfb\u5217\u662f\u6211\u5199\u7684\u7b2c\u4e09\u4e2a\u7cfb\u5217\uff0c\u524d\u4e24\u4e2a\u7cfb\u5217\u5206\u522b\u662f JavaScript \u6df1\u5165\u7cfb&#8230;<\/p>\n<p class=\"read-more\"><a class=\"btn btn-default\" href=\"https:\/\/www.lccc.top\/?p=1363\"> Read More<span class=\"screen-reader-text\">  Read More<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-1363","post","type-post","status-publish","format-standard","hentry","category-learn"],"_links":{"self":[{"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/posts\/1363"}],"collection":[{"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.lccc.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1363"}],"version-history":[{"count":1,"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/posts\/1363\/revisions"}],"predecessor-version":[{"id":1478,"href":"https:\/\/www.lccc.top\/index.php?rest_route=\/wp\/v2\/posts\/1363\/revisions\/1478"}],"wp:attachment":[{"href":"https:\/\/www.lccc.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1363"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.lccc.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1363"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.lccc.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1363"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}