Last Updated: September 09, 2019
·
494
· timuric

Convert node list to a true array

You can use slice method to convert list of html nodes to a true array

var divTags = Array.prototype.slice.call(document.querySelectorAll("div"));

Great article about small and nifty js tips:
http://tech.pro/tutorial/1453/7-javascript-basics-many-developers-aren-t-using-properly?utm_source=javascriptweekly&utm_medium=email