{"id":43973,"date":"2023-12-11T15:01:28","date_gmt":"2023-12-11T07:01:28","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=43973"},"modified":"2023-12-11T15:01:28","modified_gmt":"2023-12-11T07:01:28","slug":"%e5%86%99%e4%b8%80%e4%b8%aanewbind%e5%87%bd%e6%95%b0%ef%bc%8c%e5%ae%8c%e6%88%90bind%e7%9a%84%e5%8a%9f%e8%83%bd-2","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/11\/%e5%86%99%e4%b8%80%e4%b8%aanewbind%e5%87%bd%e6%95%b0%ef%bc%8c%e5%ae%8c%e6%88%90bind%e7%9a%84%e5%8a%9f%e8%83%bd-2\/","title":{"rendered":"\u5199\u4e00\u4e2anewBind\u51fd\u6570\uff0c\u5b8c\u6210bind\u7684\u529f\u80fd?"},"content":{"rendered":"<p>&#8220;`&#8221;                    \u53c2\u8003\u56de\u7b54\uff1a<\/p>\n<p>bind\uff08\uff09\u65b9\u6cd5\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u51fd\u6570\uff0c\u5f53\u8fd9\u4e2a\u65b0\u51fd\u6570\u88ab\u8c03\u7528\u65f6\uff0cbind\uff08\uff09\u7684\u7b2c\u4e00\u4e2a\u53c2\u6570\u5c06\u4f5c\u4e3a\u5b83\u8fd0\u884c\u65f6\u7684this\uff0c\u4e4b\u540e\u7684\u4e00\u5e8f\u5217\u53c2\u6570\u5c06\u4f1a\u5728\u4f20\u9012\u7684\u5b9e\u53c2\u524d\u4f20\u5165\u4f5c\u4e3a\u5b83\u7684\u53c2\u6570<\/p>\n<p>&lt;pre&gt;&lt;code class=&quot;&quot;language-javascript&quot;&quot; lang=&quot;&quot;javascript&quot;&quot;&gt;Function.prototype.bind2 = function (context) {<br \/>\nif (typeof this !== &quot;&quot;function&quot;&quot;) {<br \/>\nthrow new Error(&quot;&quot;Function.prototype.bind &#8211; what is trying to be bound is not callable&quot;&quot;);<br \/>\n}<br \/>\nvar self = this;<br \/>\nvar args = Array.prototype.slice.call(arguments, 1);<br \/>\nvar fNOP = function () {};<br \/>\nvar fbound = function () {<br \/>\nself.apply(this instanceof self ? this : context, args.concat(Array.prototype.slice.call(arguments)));<br \/>\n}<br \/>\nfNOP.prototype = this.prototype;<br \/>\nfbound.prototype = new fNOP();<br \/>\nreturn fbound;<br \/>\n}<br \/>\n&lt;\/code&gt;&lt;\/pre&gt;<\/p>\n<p>\u00a0<\/p>\n<p>&lt;pre&gt;&lt;code&gt;            &quot;&#8220;`<br \/>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;`&#8221; \u53c2\u8003\u56de\u7b54\uff1a bind\uff08\uff09\u65b9\u6cd5\uff0c\u521b\u5efa\u4e00\u4e2a\u65b0\u51fd\u6570\uff0c\u5f53\u8fd9\u4e2a\u65b0\u51fd\u6570\u88ab\u8c03\u7528\u65f6\uff0cbind\uff08 [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-43973","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/43973","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=43973"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/43973\/revisions"}],"predecessor-version":[{"id":43974,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/43973\/revisions\/43974"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=43973"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=43973"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=43973"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}