Could we help you? Please click the banners. We are young and desperately need the money
Sometimes in JavaScript you receive iterable objects such as Iterators (for example, through Map.prototype.keys()) or NodeList (for example, through document.querySelectorAll()). While these have their benefits and reasons to exist within JavaScript, often you'd rather just have an array (perhaps for the convenient helper methods).
The currently best supported and most widely applicable solution is using Array.from() like this:
Array.from(iterable)
A new and more convenient solution, which unfortunately isn't baseline available yet, is the chainable toArray() method. It lives on Iterator instances and can be used like so:
iterator.toArray()