September 2017
Intermediate to advanced
216 pages
6h 8m
English
Let's see what happens when we call printValues() when we try adding a duplicate value to myOrderedSet:
console.log('adding 3 again');printValues(myOrderedSet.add(Map.of('three', 3)));// -> adding 3 again
The side-effect doesn't run because the value that we're trying to add with add() isn't actually added since it's a duplicate of a value that's already in the set.
Read now
Unlock full access