-
bind 函数科里化功能:把一个函数拆成多个单元 function add(a,b,c){return a+b+c;} 如:先调用前两个值,得到的函数再调用,每次都传入第三个值; var func=add.bind(undefined,100); 若不需要改变其this,则随便传个undefined; 100 会赋值给第一个参数a, func(1,2); 1会赋值给b,2会赋值给c //103 var func2=func.bind(undefined,200); func把100传入了a,func2把200传入了b func2(10); //100+200+10=310 bind了两次查看全部
-
call apply bind 方法 call(100,1,2)它们第一个参数为需要作为this的对象 call/apply(null/undefined) this指定为null或undefined时,会指向全局对象(浏览器):window (node.js):global 严格模式下会返回null或undefined查看全部
-
bind 方法是ES5才提供的方法 即IE9+才支持 绑定this的返回值查看全部
-
什么是原型链查看全部
-
都是什么查看全部
-
reduce遍历数组查看全部
-
类型检测 typeof查看全部
-
arr.unshift(something); 在数组的第一个元素前添加新元素查看全部
-
map方法查看全部
-
this arguments 作用域 不同调用方式 不同调用方法 不同调用方法: 直接调用:foo(); 对象方法:o.method(); 构造器:new Foo(); call/apply/bind:func.call(o);查看全部
-
typeof判断基本类型和函数对象,遇到null则用严格等于判断是否等于null instanceof可以判断原型链上的类型,iframe和window会失效 Object.prototype.toString;除了null和undefined查看全部
-
js没有块级作用域查看全部
-
基本类型本身是没有方法的,当使用方法时会临时包装成一个对象,当临时对象使用完就会被销毁。查看全部
-
bind方法查看全部
-
Array.prototype.join Array.prototype.reverse Array.prototype.sort Array.prototype.concat Array.prototype.slice 切片 Array.prototype.splice 胶接 Array.prototype.forEach (ECMA Script 5) Array.prototype.map (ECMA Script 5) Array.prototype.filter (ECMA Script 5) Array.prototype.every (ECMA Script 5) Array.prototype.some (ECMA Script 5) Array.prototype.reduce/reduceRight (ECMA Script 5) Array.prototype.indexOf/lastIndexOf (ECMA Script 5) Array.isArray Array.prototype. Array.prototype.查看全部
举报
0/150
提交
取消