Changing Case

We use this case to either convert all the string into lowercase or uppercase. To use lowercase, we write like toLowerCase() and to use uppercase, we write like toUpperCase().

Code Structure
var actorCheck = prompt("Enter the name");
actorCheck = actorCheck.toLowerCase();
var actors = ["jessica", "rocky", "arnold", "jackie"];
for(var i = 0; i < actors.length; i++){
 if(actorCheck === actors[i]){
  alert("Popular Actors");

Share this

Related Posts