Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:124.0) Gecko/20100101 Firefox/124.0
Firefox 124
Windows
Desktop
10 months ago
Test name Executions per second
includes 32341952.0 Ops/sec
lookup 1503163008.0 Ops/sec
indexof 37468484.0 Ops/sec
Script Preparation code:
AخA
 
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)
Tests:
  • includes

     
    return a.includes('mx')
  • lookup

     
    return b.has('mx')
  • indexof

     
    return a.indexOf('mx') >= 0