Global Object Flashcards

1
Q

Name all global object properties (4 properties)

A

Infinity
NaN
undefined
globalThis

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

Name all global object functions (1 + 4 number methods + 4 encode decode URI)

A

eval()

isFinite()
isNaN()
parseFloat()
parseInt()

encodeURI()
encodeURIComponent()
decodeURI()
decodeURIComponent()

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

What does globalThis refer to?

A

the global object
Window in browser
Global Object in node and vs code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
All global object properties can be accessed on their own:
alert("Hello");
vs
window.alert("Hello");
t or f
A

t

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
When you write var:
var gVar = 5;
Where is it actually placing the variable?
A

As a property on the global object
alert(window.gVar); // 5
global functions and variables declared with var (not let/const!) become the property of the global object:

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

var gVar = 5;
is not the same as
global.gVar = 5
t or f

A

f

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