DEV Community

Discussion on: Big-O Notation Cheatsheet

Collapse
 
qm3ster profile image
Mihail Malo

Yeah, in theory. But V8 does a lot of runtime optimization. A for loop incrementing by 1 over specifically a continuous array surely doesn't actually do hashmap lookups with the integer at every iteration. I'm sure that no kind of SIMD is taking place, but when it sees that there are no break/continue branches, surely it at least iterates over the values directly?