# 类数组转化为数组

类数组具有 length 属性,但不具有数组原型上的方法。常见的类数组有 arguments、DOM操作方法返回的结果。

方法一:Array.from

Array.from(arguments);
1

方法二:Array.prototype.slice.call()

Array.prototype.slice.call(arguments)
1

方法三:扩展运算符

[...arguments]
1

方法四:利用concat

[].concat(arguments);
1
上次更新: 1/5/2022, 9:25:14 AM