摘要: Part 1 Arguments对象是一个类数组对象,用来表示传递给JS方法的参数: function testArgs(a,b,c){ console.log(arguments[0]); //expected output:1 console.log(arguments[1]); //expec 阅读全文
posted @ 2020-09-10 17:53 张馨 阅读(184) 评论(0) 推荐(0) 编辑
摘要: 以NodeList对象为例展开: NodeList是由一些元素节点组成的一个集合,比如我们通过document.getElementByTagName()或document.querySelectorAll()方法,又或者Node.childNodes属性返回而获得的。 它是一个典型的类数组对象,具 阅读全文
posted @ 2020-09-10 15:11 张馨 阅读(279) 评论(0) 推荐(0) 编辑
摘要: 当在JS方法中我们不能确定参数数量的情况时 用来表示这些参数: function sum(...theArgs) { return theArgs.reduce((previous,current) => { return previous + current } ); } console.log( 阅读全文
posted @ 2020-09-10 10:39 张馨 阅读(147) 评论(0) 推荐(0) 编辑