1 (function(){
2 console.log(arguments instanceof Array); // false 
3 var argsArray = Array.prototype.slice.call(arguments);
4 console.log(argsArray instanceof Array); // true 
5 }());

 

getElementsByTagName返回的NodeList也可以转化成数组

1 Array.prototype.slice.call(nodes)

 

相关文章:

  • 2021-10-21
  • 2021-04-05
  • 2022-02-13
  • 2022-12-23
  • 2021-12-19
  • 2022-03-05
  • 2022-01-01
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-20
  • 2022-01-20
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案