Run details:
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36
Chrome 125
Windows
Desktop
one year ago
Test name Executions per second
a[i].startsWith(b[i]) when a[i] strictly equals b[i] 11.2 Ops/sec
a[i].startsWith(b[j]) when a[i] different than b[j] 125.9 Ops/sec
a[i] === b[i] when a[i] strictly equals b[i] 424.2 Ops/sec
a[i] === b[j] when a[i] different than b[j] 245.3 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]