I am confused... You are not calculating in the array creation time for the map. Why? No, map can' be faster, map should be always slower!! Come on! 65 likes and no one noticed this? The loop obviously slower, because you creating a new array. And pushing items to the array with overindexing like array[nonexistent]=1 I am not sure it is a great idea, I would've used array.push.
This dude never lets me disappointed
You drop this video in the perfect time due, I'm just about to benchmark those two approach haha. Thanks.
Wait I though, map, Map or Hashtable (POJO) things haha. But this still cools tho.
Yeah. Why do the function and data structure have the same name???
I am confused... You are not calculating in the array creation time for the map. Why? No, map can' be faster, map should be always slower!! Come on! 65 likes and no one noticed this? The loop obviously slower, because you creating a new array. And pushing items to the array with overindexing like array[nonexistent]=1 I am not sure it is a great idea, I would've used array.push.