hasTrailingSlash

Benchmark created on


Setup

const str = 'heXllo/bye\3455dfws/';

Test runner

Ready to run.

Testing in
TestOps/sec
CharAt
str.charAt(str.length-1) == '/'
ready
Array
str[str.length-1] == '/'
ready
EndsWith
str.endsWith('/')
ready
Match
str.match('/\/$/')
ready
Slice
str.slice(-1) == '/'
ready
At
str.at(-1) == '/'
ready

Revisions

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