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

Exercise prompt

Allow Either Option

The logical OR operator || returns true when at least one condition is true.

Example

const hasKey = false; const doorIsOpen = true; const canEnter = hasKey || doorIsOpen;

canEnter is true because one option works.

Your task

Complete canPay so either a card or cash is enough. The console should display Can pay: true.