Run details:
Mozilla/5.0 (Linux; Android 9; SAMSUNG SM-G955N) AppleWebKit/537.36 (KHTML, like Gecko) SamsungBrowser/16.0 Chrome/92.0.4515.166 Mobile Safari/537.36
Chrome Mobile 92
Android
Mobile
3 years ago
Test name Executions per second
slice 3607883.5 Ops/sec
substr 3513351.5 Ops/sec
substring 3418009.5 Ops/sec
Script Preparation code:
AخA
 
var example = 'there is no spoon'
Tests:
  • slice

     
    var result = example.slice(10)
  • substr

     
    var result = example.substr(10)
  • substring

     
    var result = example.substring(10)