Examples:
palindrome("abba") === true
palindrome("abcdefg") === false
function palindrome(str) { return str.split('').every((char, indx) => char === str[str.length-indx-1]); }
Not the best solution because it performs not necessary operations after checking half of the string.