What is the difference between the two?
So I know that array.size() is a function while array.length is a property. Is there a usecase for
array.size()
array.length
Size detects duplicates, it will return the number of unique values
const set1 = new Set([1, 2, 3, 4, 5, 5, 5, 6]); console.log(set1.size); // expected output: 6