Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert an iterable object to an array

const foo = document.querySelectorAll('.foo');

// good
const nodes = Array.from(foo);

// best
const nodes = [...foo];
Source by github.com #
 
PREVIOUS NEXT
Tagged: #convert #iterable #object #array
ADD COMMENT
Topic
Name
7+2 =