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

Friday, December 7, 2012

LearnStreet Javascript Lesson 5 Exercise 3


//sample solution


function authenticate(password) {
    var successMessage = "you are now logged in!";
    var failureMessage = "oops. try again.";
    //Complete the rest of the function body to check if the password is "jsrocks".
    if(password==="jsrocks"){
        return successMessage;
    } else {
        return failureMessage;
    }
}
//
authenticate("pythonrocks");

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts