- Array
Array.from(map.values());
- for...of
for (let [key, value] of iterable) {
console.log(value);
}
A Map object iterates its elements in insertion order — a for...of loop returns an array of [key, value] for each iteration.
Refercences
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators
Array.from(map.values());
- for...of
for (let [key, value] of iterable) {
console.log(value);
}
A Map object iterates its elements in insertion order — a for...of loop returns an array of [key, value] for each iteration.
Refercences
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for...of
- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Iterators_and_Generators
댓글
댓글 쓰기