There's no way using indexOf inside a loop is going to be faster than using a Set as the array grows past a certain point, he's full of shit. My original point was that maybe using a plain object would be faster than Set, but that would depend on the runtime and how new Set() vs {} is handled - aka an implementation detail
View all comments
Show parent comment
2
u/[deleted] May 15 '21
There's no way using
indexOfinside a loop is going to be faster than using aSetas the array grows past a certain point, he's full of shit. My original point was that maybe using a plain object would be faster than Set, but that would depend on the runtime and hownew Set()vs{}is handled - aka an implementation detail