Script Preparation code:
x
 
var string = 'x';
var stringToCheck = 'alksjdflaksjdlkajtlkadjsta;ksdglkasdjfadsfaf';
var result = null;
Tests:
  • .endsWith

     
    result = stringToCheck.endsWith(string);
  • .includes

     
    result = stringToCheck[ stringToCheck.length - 1 ] === string;
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    .endsWith
    .includes

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 2 years ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:108.0) Gecko/20100101 Firefox/108.0
Firefox 108 on Windows
View result in a separate tab
Test name Executions per second
.endsWith 260660864.0 Ops/sec
.includes 267942080.0 Ops/sec