Script Preparation code:
x
 
var a = [
    'height',
    'width',
    'maxHeight',
    'maxWidth',
    'maxHeight',
    'minWidth',
    'color',
    'bg',
    'backgroundColor',
    'opacity',
    'm',
    'mt',
    'mb',
    'mr',
    'mr',
    'mx',
    'my',
    'p',
    'pt',
    'pb',
    'pr',
    'pl',
    'px',
    'py',
    'border',
    'boxShadow',
    'flex',
    'verticalAlign',
    'textAlign',
    'overflow',
    'display',
    'cursor'
];
var b = new Set(a)
var c = a.slice();
c.push('abc','def','ghi','other word', 'notinlist','123','4334232313','borderwersese');
Tests:
  • arr.includes

     
    return a.includes(c[Math.floor(Math.random() * c.length)])
  • set.has

     
    return b.has(c[Math.floor(Math.random() * c.length)])
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    arr.includes
    set.has

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 4 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36
Chrome 87 on Windows
View result in a separate tab
Test name Executions per second
arr.includes 1593768.0 Ops/sec
set.has 1651396.5 Ops/sec