I have been wondering recently if accessing the array.length
getter was cached by NodeJS, but I have only been able to find conclusive answers regarding JS interpretation in browsers, but I am developping apps in Typescript, so that's not relevant to my question (correct me if I'm wrong)
So, is accessing array.length
of time complexity O(1) (cached by NodeJS) or O(n) (not cached by NodeJS) in NodeJS 14 ?
I have a hunch that it is cached, but I'd really like a definitive answer or "proof" of it