string - Javascript- Uppercase letters to lower case and vise versa -
i interested in making uppercase letters lowercase , lowercase letters uppercase. if have code below code, should put in blank spaces of if/else statement: if (string[i] == )
, else if (string [i] == )
. here rest of code:
var sentence = "whats up! make me uppercase or lowercase"; var thestring = sentence.split("") (var = thestring.length; >= 0; i--) { if (thestring[i] == ) { thestring[i].tolowercase(); } else if (thestring [i] == ) { thestring[i].touppercase(); } } var connectedsentence = thestring.join(""); console.log(connectedsentence);
have made other mistakes? expected output make me uppercase or lowercase.
if (thestring[i] == thestring[i].touppercase()) { thestring[i]= thestring[i].tolowercase(); } else if (thestring[i] == thestring[i].tolowercase()) { thestring[i]= thestring[i].touppercase(); }
Comments
Post a Comment