Quotes help make search much faster. Example: "Practice Makes Perfect"

Friday, December 7, 2012

LearnStreet Javascript Lesson 5 Exercise 6


//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


This is an example of scrolling text using Javascript.

Popular Posts