Javascript Performance
Data Structures
- Prefer
sorted array
for O(n log n).
Engine Optimizations
Slow (HashTable):
Faster (Array):
Changing the index to ‘0’ is faster because the array implementation is faster than HashTable.
Source: Fast By Default: Algorithmic Performance Optimization in Practice