Test name | Executions per second |
---|---|
indexation | 24273.1 Ops/sec |
arr | 682542.1 Ops/sec |
let arr = {}
for (let i=0; i<500; i++) {
arr = { arr, [+i]: { id: +i, foo: 'bar'}}
}
const test = arr[40]
const arr = []
for (let i=0; i<500; i++) {
arr.push({ id: +i, foo: 'bar'})
}
const test = arr.find(x => x.id === 40)