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.8 Ops/sec
a[i].startsWith(b[j]) when a[i] different than b[j] 142.3 Ops/sec
a[i] === b[i] when a[i] strictly equals b[i] 422.7 Ops/sec
a[i] === b[j] when a[i] different than b[j] 216.8 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]