Substring

Benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
String#Substring
const str = "name"

const sr = (s, i) => {
	const a = i % s.length
	return s.slice(-a) + s.slice(0, -a)
}

sr(str)
ready
Random shit
const str = "name"

const sr = (s) => {
	const a = s.split('')
	return [a.pop(),...a].join('')
}

sr(str)
ready

Revisions

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