EndsWith constant single character

JavaScript performance comparison

Test case created by

Preparation code


      
      <script>
Benchmark.prototype.setup = function() {
  var s = "asdjhf galdfg aljdhfg ajlfdhgb fnmbv x,cvnb kxfgzbh f";

};
</script>

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
charAt fail
s.charAt(s.length - 1) === "g";
pending…
charAt pass
s.charAt(s.length - 1) === "f";
pending…
regex fail
/g$/.test(s);
pending…
regex pass
/f$/.test(s);
pending…

You can edit these tests or add even more tests to this page by appending /edit to the URL.

Compare results of other browsers

0 Comments