If statement nested

Nest level in Javascript are communicated by the position of curly brackets.

Code Structure
var firstName = prompt("Enter your first name");
var lastName = prompt("Enter your last name");
if(firstName === "David") {
 if(lastName === "Beckham") {
  alert("You are a great footballer.");
 }
}

Share this

Related Posts