tl;dr: constant values are immutable and could be compared by value not identity…?
Problem:
let a = new Set([ [1], [1] ]);
This produces a set with two members.
Proposal:
const rgb1 = [128,128,128];
const rgb2 = [128,128,128];
let rgb3 = [128,128,128];
let colors = new Set([ rgb1, rgb2]);
let moreColors = new Set([...colors, rgb3])
// prints one color
// constants could be compared by value, not identity..?
for (let col of colors){
console.log(col);
}
// prints two lines, as one constant (read, immutable) and one let bound do not
// compare as being equal
for (let col of moreColors) {
console.log(col)
}
Does this make sense?