Test name | Executions per second |
---|---|
Includes | 15470768.0 Ops/sec |
Object[key] | 14432183.0 Ops/sec |
var obj = (new Array(1000)).fill(null).reduce((prev, newVal) => {prev[Math.random() + ''] = Math.random() + ''; return prev; }, { sausage: 'tst' });
var array = Object.keys(obj);
array.includes('sausage')
obj['sausage']