Last active
December 21, 2015 10:09
-
-
Save linkgod/6289733 to your computer and use it in GitHub Desktop.
changes arguments to "true" array
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var argsArr = Array.prototype.slice.call(arguments); | |
// changes arguments to "true" array | |
// 把 arguments 转换成一个“真正的”数组 | |
var nodesArr = Array.prototype.slice.call(document.querySelectorAll("div")); | |
// "true" array of DIVs | |
// 得到一个由 div 元素组成的“真正的”数组 | |
// document.querySelectorAll("div")得到的不是一个类数组 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment