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

Friday, December 7, 2012

LearnStreet Javascript Lesson 4 Exercise 3


//sample solution


function capitalizeFirst(str) {
    /*Write the function body below to return a string that is
      identical to str except that its first letter is capitalized.*/
    return str[0].toUpperCase()+str.substring(1,str.length);
}
//test
capitalizeFirst("ant");

No comments:

Post a Comment


This is an example of scrolling text using Javascript.

Popular Posts