Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:95.0) Gecko/20100101 Firefox/95.0
Firefox 95
Windows
Desktop
2 years ago
Test name Executions per second
a[i].startsWith(b[i]) when a[i] strictly equals b[i] 29.0 Ops/sec
a[i].startsWith(b[j]) when a[i] different than b[j] 32.3 Ops/sec
a[i] === b[i] when a[i] strictly equals b[i] 162.3 Ops/sec
a[i] === b[j] when a[i] different than b[j] 40.6 Ops/sec
Script Preparation code:
Tests:
  • a[i].startsWith(b[i]) when a[i] strictly equals b[i]

  • a[i].startsWith(b[j]) when a[i] different than b[j]

  • a[i] === b[i] when a[i] strictly equals b[i]

  • a[i] === b[j] when a[i] different than b[j]