Skip to content

Latest commit

 

History

History
25 lines (23 loc) · 555 Bytes

cinema-hall-without-else.md

File metadata and controls

25 lines (23 loc) · 555 Bytes

A cinema is showing movie to childeren (age < 18) for free and charging adults (age >= 18) with $10 per ticket.

For adults:

Please pay $10.
Please proceed to the cinema hall.

For children:

 Please proceed to the cinema hall.

CODE

let age = 34;
if(age >= 18){
  console.log("Please pay $10.");
  console.log("Please proceed to the cinema hall.");
}
else{
  console.log("Please proceed to the cinema hall.");
}

Write code to achieve the same output WITHOUT using an else block. Note: You can use just a single if statement