3 ms·
AFAIK there is no mechanism to do the following const a = { value: 1 } const b = { value: 1 } const set = new Set([a, b]) set.size will be 2 as JavaScript ch
by leosanchez 3y ago
AFAIK there is no mechanism to do the following
const a = { value: 1 }
const b = { value: 1 }
const set = new Set([a, b])
set.size will be 2 as JavaScript checks for reference equality and has no mechanism check equality on a specific property