slice vs length - 1 (v14)

Revision 14 of this benchmark created on


Setup

var x = "#/1fdefg/2fdsfe";

Test runner

Ready to run.

Testing in
TestOps/sec
slice
var y = x.replace("#/", "").split("/").slice(-1)[0]
ready
length - 1
var y = x.replace("#/", "").split("/").pop()
ready

Revisions

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