Content deleted Content added
→JavaScript: copy editing |
→JavaScript: copy editing |
||
Line 582:
In this example, the sallyNumber value will now contain the string "555-9999".
=====
The keys in a map are ordered. Thus, when iterating
▲The keys in a map are ordered. Thus, when iterating over it, a map object returns keys in order of insertion. The following demonstrates enumeration using a for-loop:
<syntaxhighlight lang=JavaScript>
// loop through the collection and display each entry.
for(const [name, number] of phoneBook) {
console.log(
}
</syntaxhighlight>
|