Boolean Flashcards

1
Q

Attributes

A
Primitive data type / immutable
Contains methods
#safe
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Instantiation

A
// literal
true
// constructor; if arg is truthy, true, else false
Boolean(1)  // primitive
new Boolean(1)  // object
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Methods (2)

A

.toString —string representation of boolean

.valueOf —return primitive value of boolean object

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