0 of 8 problems solved • 0%
Use in a course

Exercise prompt

Combine Requirements

The logical AND operator && returns true only when both conditions are true.

Example

const oldEnough = true; const hasTicket = true; const canEnter = oldEnough && hasTicket;

canEnter is true.

Your task

A visitor can enter only when they are at least 18 and have a ticket. Build canEnter from both requirements and display Can enter: true.