apply&slice方法将类似数组的对象转换成数组
Array.prototype.slice.apply({0: 1, length: 1})
Array.prototype.slice.apply({0: 1})
Array.prototype.slice.apply({0: 1, length: 2})
Array.prototype.slice.apply({length: 1})
[1, 2, 3].slice(0, 1)
Array.prototype.slice.call([1, 2, 3], 0, 1)
var push = Function.prototype.call.bind(Array.prototype.push);
var pop = Function.prototype.call.bind(Array.prototype.pop);
var a = [1 ,2 ,3];
push(a, 4)
a
pop(a)
a
转载请注明原文地址:https://ipadbbs.8miu.com/read-62728.html