HTML Preparation code:
AخA
 
1
<!--your preparation HTML code goes here-->
Script Preparation code:
x
 
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 1

     
    omit({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10 }, ['b']);
  • omit2 1

     
    omit({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10 }, ['b']);
  • omit 8

     
    omit({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10 }, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']);
  • omit2 8

     
    omit2({ a: 1, b: 2, c: 3, d: 4, e: 5, f: 6, g: 7, h: 8, i: 9, j: 10 }, ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h']);
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    omit 1
    omit2 1
    omit 8
    omit2 8

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 days ago)
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
Opera 117 on Mac OS X 10.15.7
View result in a separate tab
Test name Executions per second
omit 1 6259850.0 Ops/sec
omit2 1 6273293.5 Ops/sec
omit 8 1159204.1 Ops/sec
omit2 8 2237010.0 Ops/sec