JavaScript.info > Conditional branching: if, '?' > Flashcards
all become false. Because of that they are called “falsy” values.
A number 0,
an empty string “”,
null,
undefined,
NaN
shorten below and why
let accessAllowed = age > 18 ? true : false;
let accessAllowed = age > 18
can avoid using the question mark operator because the comparison itself returns true/false: