Post

After all it takes an Array as input. Re-reading the doc, it's clear why it is attached on Object. It works not just on arrays but on any iterable (developer.mozilla.org/en-US/docs/W...) My second question is, why does it return a (null prototype) object acting as a map instead of map?

developer.mozilla.orgIteration protocols - JavaScript | MDNIteration protocols aren't new built-ins or syntax, but protocols. These protocols can be implemented by any object by following some conventions.

0 reposts0 likes