Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
omit (reduce) vs omit (Object.fromEntries)
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/132.0.0.0 Safari/537.36 OPR/117.0.0.0
Browser:
Opera 117
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
one year ago
Test name
Executions per second
omit
20824730.0 Ops/sec
omit2
4754117.0 Ops/sec
HTML Preparation code:
<!--your preparation HTML code goes here-->
Script Preparation code:
function omit(obj, keys) { return keys.reduce((a, e) => { const { [e]: _, ...rest } = a; return rest; }, obj); } function omit2(obj, keys) { return Object.fromEntries(Object.entries(obj).filter(([k]) => !keys.includes(k))); }
Tests:
omit
omit({ a: 1, b: 2, c: 3 }, ['b']);
omit2
omit2({ a: 1, b: 2, c: 3 }, ['b']);