Palindome

Benchmark created on


Setup

function palindromeReverse(input) {
	return input == input.split("").reverse().join("");
}


function palindromeChars(input){
	let i = 0, j = input.length - 1;
	while (i < j) {
		if (input.charAt(i) != input.charAt(j)) {
			return false;
		}
		i++; j--;
	}
	return true;
}

Test runner

Ready to run.

Testing in
TestOps/sec
Reverse
palindromeReverse("ecypmvxnakojpdvcunulgjskcpmkkwqjfiunadjphjkqquqnxppxnquqqkjhpjdanuifjqwkkmpcksjglunucvdpjokanxvmpyce");
ready
Chars
palindromeChars("ecypmvxnakojpdvcunulgjskcpmkkwqjfiunadjphjkqquqnxppxnquqqkjhpjdanuifjqwkkmpcksjglunucvdpjokanxvmpyce");
ready

Revisions

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