JavaScript Array Length Time Complexity

Benchmark created on


Setup

const numbers1= [...Array(1000).keys()]
const numbers2= [...Array(10000).keys()]

Test runner

Ready to run.

Testing in
TestOps/sec
Array length for 1000 elements
console.log(numbers1.length)
ready
Array length for 10000 elements
console.log(numbers2.length)
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.