把arguments转化成数组

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)
原文地址:https://www.cnblogs.com/qzsonline/p/2554513.html