September 2017
Intermediate to advanced
216 pages
6h 8m
English
Sets are like maps in that they don't have a defined iteration order. This means that using a for...of loop or the forEach() method could have unexpected results, as follows:
console.log('myList.forEach()');myList.forEach(v => console.log(v));// -> myList.forEach()// -> 1// -> 2// -> 3console.log('mySet.forEach()');mySet.forEach(v => console.log(v));// -> mySet.forEach()// -> 1// -> 2// -> 3
Read now
Unlock full access