中等JavaScript
0 1

请解释:JavaScript的类数组对象?如何转化为数组 是什么?

【概念释义】

类数组对象 有 length 与索引(0..length-1)但非 Array,如 arguments、NodeList、HTMLCollection。转数组:Array.from[...iterable]Array.prototype.slice.call

【基础使用】

javascript
function demo() {
  const args = Array.from(arguments);
  return args.map((x) => x * 2);
}
const nodes = document.

登录查看完整 713

回答讨论

暂无讨论,登录后可抢先发言

本题库更多题目(50)