21 Flashcards

(5 cards)

1
Q

Falsy Values

A

values that resolve to the Boolean false

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Truthy Values

A

values that resolve to the Boolean true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Which Falsy Values exist?

A

0
‘’ (empty String)
undefined
null
NaN

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Boolean(‘Jonas’)

A

true
(any string that is not empty is a truthy value)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

if(height)

A

tests if the variable height is defined (has a value)
Example:
let height;
if(height) → false (undefined)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly