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