bind手写(Lucas小册1-1番外篇)
普通版本
1 | Function.prototype.bind = Function.prototype.bind || function (context) { |
能在构造函数场景下兼容
1 | Function.prototype.bind = Function.prototype.bind || function (context) { |
bind的偏函数用法,可以用于预设参数
1 | function list(){ |
1 | Function.prototype.bind = Function.prototype.bind || function (context) { |
1 | Function.prototype.bind = Function.prototype.bind || function (context) { |
1 | function list(){ |