Run details:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/142.0.0.0 Safari/537.36
Chrome 142
Mac OS X 10.15.7
Desktop
5 months ago
Test name Executions per second
a[i].startsWith(b[i]) when a[i] strictly equals b[i] 11.1 Ops/sec
a[i].startsWith(b[j]) when a[i] different than b[j] 125.3 Ops/sec
a[i] === b[i] when a[i] strictly equals b[i] 386.6 Ops/sec
a[i] === b[j] when a[i] different than b[j] 193.2 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]