Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/113.0.0.0 Safari/537.36
Chrome 113
Linux
Desktop
one year ago
Test name Executions per second
slice 18214332.0 Ops/sec
substr 18641246.0 Ops/sec
substring 18569068.0 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)