JS Conditional
A condition lets the program choose a value or a branch. Make the condition read like a question.
Where to run this
This example uses the JavaScript console playground. Select Run to execute it; the example does not run on this lesson page.
A practical example
const places = 0;
const message = places > 0 ? "Book a place" : "Join the waiting list";
console.log(message);
What happens
The message invites the visitor to join the waiting list.