May 5, 2023
there are various errors in the examples code (missing open curly, arrayFinal2["element"] = 1 instead of arrayFinal2[element] = 1, etc) but most importantly, this post demonstrates that a loop that does nothing is faster than a loop that does something, because JIT and engines optimize for you. If you need to use properties instead of indexes don't use arrays, use either a `Map` or an object instead.