Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Some vs includes
(version: 0)
Comparing performance of:
some vs includes
Created:
5 years ago
by:
Guest
Jump to the latest result
Script Preparation code:
var array1 = []; var array2 = new Array(100).fill(0).map((x, i) => { return { id : i } })
Tests:
some
array2.forEach((x) => { if (!array1.some(({ id }) => id === x.id)) { array1.push(x) } })
includes
array2.forEach((x) => { if (!array1.includes(x)) { array1.push(x) } })
Rendered benchmark preparation results:
Suite status:
<idle, ready to run>
Run tests (2)
Previous results
Fork
Test case name
Result
some
includes
Fastest:
N/A
Slowest:
N/A
Latest run results:
Run details:
(Test run date:
6 months ago
)
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/141.0.0.0 Safari/537.36
Browser/OS:
Chrome 141 on Mac OS X 10.15.7
View result in a separate tab
Embed
Embed Benchmark Result
Test name
Executions per second
some
404651.7 Ops/sec
includes
1324223.6 Ops/sec
Related benchmarks:
Array.from() vs new Array() performance...
Array.from() vs new Array() - map
Array.fill vs Array.from with dyamnic data
Array.from() vs new Array().map()
Array.from vs new Array using index value
Comments
Confirm delete:
Do you really want to delete benchmark?