Methods of primitives Flashcards

1
Q

There are 7 primitive types:

A

string, number, bigint, boolean, symbol, null and undefined.

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

alert( typeof 0 ); //

A

“number”

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

alert( typeof new Number(0) ); //

A

“object”!

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

Objects are always truthy in ____ statements

A

if

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

let num = Number(“123”); // returns?

A

convert a string to number

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

___ and ____ have no methods

A

null/undefined h

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