Test name | Executions per second |
---|---|
.some() | 248658.1 Ops/sec |
.map().includes() | 26016.1 Ops/sec |
<!--your preparation HTML code goes here-->
var data = []
for (let i = 0; i < 5000; ++i) data.push({ username: 'toto' })
data.push({ username: 'titi' })
for (let i = 0; i < 2500; ++i) data.push({ username: 'toto' })
data.some((e) => e.username === 'titi')
data.map((e) => e.username).includes('titi')