-
Notifications
You must be signed in to change notification settings - Fork 4k
Closed
Description
In https://javascript.info/map-set 1-js/05-data-types/07-map-set there is the following excerpt:
A call to
map.entries()returns an array of key/value pairs, exactly in the right format forObject.fromEntries.
However, map.entries() returns an iterable. Should it not be correct to say it instead of "returns an array"?
Actually, you could easily convert a map/set into an array using the spread operator:
let arr = [...map];
let arr = [...set];
I don't know if you think that would be relevant for that lesson. I would think so, because this way you can go from a map/set to an array and use whatever function you want, like: reduce, map, etc.
The exercise "Iterable keys" kind of hints at that as you would have to call Array.from().
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels