//sample solution
function fivePalindrome(word) {
//Code the function body below.
var wordLength = word.length;
if(wordLength===5 && word.charAt(0)===word.charAt(4) && word.charAt(1)===word.charAt(3)){
return true;
} else {
return false;
}
}
//test
fivePalindrome("civic");
No comments:
Post a Comment