类数组对象
一、什么是类数组对象?
let arrayLikeObj = {
0: 'rory',
1: 18
}二、常见类数组
三、将类数组转成数组
function show(...params) {
console.log([...arguments])
}Last updated
let arrayLikeObj = {
0: 'rory',
1: 18
}function show(...params) {
console.log([...arguments])
}Last updated
function show(...params) {
console.log(Array.from(arguments))
}function show() {
console.log(Array.prototype.slice.call(arguments));
console.log(Array.prototype.concat.apply([], arguments));
console.log(Array.prototype.splice.call(arguments, 0))
}