Test name | Executions per second |
---|---|
array find | 34036104.0 Ops/sec |
object index | 821263040.0 Ops/sec |
const arr = [{id:'A'}, {id:'B'}, {id:'C'}, {id:'D'}, {id:'E'}, {id:'F'}];
const item = arr.find(i=>i.id === 'C')
const obj = {
'A':{},
'B':{},
'C':{},
'D':{},
'E':{},
'F':{}
}
const item = obj['C']