splice(-1) vs charAt(lenght-1) vs index (v4)

Revision 4 of this benchmark created on


Setup

text = "my text string"

Test runner

Ready to run.

Testing in
TestOps/sec
CharAt
text.charAt(text.length-1)
ready
Index
text[text.length-1]
ready
Splice
text.slice(-1)
ready
substr
text.substr(-1)
ready
substring
text.substring(text.length-1)
ready

Revisions

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