Answers for "convert an iterable object to an array"

0

convert an iterable object to an array

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

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

// best
const nodes = [...foo];
Posted by: Guest on May-02-2021

Code answers related to "convert an iterable object to an array"

Browse Popular Code Answers by Language