Yet another example. Consider what it does before testing it.
isPalindrome.js
'use strict';
const isPalindrome = function (s) {
if(s.length <= 1)
return true;
return s[0] === s[s.length - 1] && isPalindrome(s.substring(1, s.length - 1));
}
Provide the proper input parameter, and test it in your console.