Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36
Chrome 131
Mac OS X 10.15.7
Desktop
one year ago
Test name Executions per second
a[i].startsWith(b[i]) when a[i] strictly equals b[i] 12.1 Ops/sec
a[i].startsWith(b[j]) when a[i] different than b[j] 135.5 Ops/sec
a[i] === b[i] when a[i] strictly equals b[i] 352.5 Ops/sec
a[i] === b[j] when a[i] different than b[j] 201.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]