exercises/capitalize.js
/*
 * Create a `capitalize` function that takes a string
 * and transforms it to upper case only for the first letter,
 * and in lowercase for the rest of the string
 *
 */
Create a `capitalize` function that takes a string
and transforms it to upper case only for the first letter,
and in lowercase for the rest of the string
Create a ` capitalize ` function that takes a string and transforms it to upper case only for the first letter and in lowercase for the rest of the string
function capitalize(string){
    let stringCapitalize ="";
     for(let i = 0; i < string.length; i++){
         if (i == 0){
             stringCapitalize += string[i].toUpperCase();
         }
         else {stringCapitalize += string[i].toLowerCase();
        }
    }
     return stringCapitalize;
 }
function capitalize ( string ) { let stringCapitalize = "" ; for ( let i = 0 ; i < string . length ; i ++ ) { if ( i == 0 ) { stringCapitalize += string [ i ] . toUpperCase ( ) ; } else { stringCapitalize += string [ i ] . toLowerCase ( ) ; } } return stringCapitalize ; }
Create a `capitalize` function that takes a string
 and transforms it to upper case only for the first letter,
 and in lowercase for the rest of the string
Create a ` capitalize ` function that takes a string and transforms it to upper case only for the first letter and in lowercase for the rest of the string