Closures and Scoping Flashcards

1
Q

What concept in JavaScript is the idea that programs keep track of variable locations to understand where to access them?

A

lexical scoping

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

Does JavaScript support private methods natively in the same way that languages like Java do?

A

No. Even though JavaScript does not support private methods natively in the way languages like Java do, we can still emulate this behavior using closures.

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

Closures in JS and ES6 refer to functions that remember their _____ ________and can further reference that environment’s independent variables.

A

creation environment

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

_____ ______ refers to the JavaScript concept of programs keeping track of variable locations to understand in which scopes they can be accessed.

A

Lexical scoping

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

______ ______ create functions based on returning inner functions that manipulate its own arguments and the arguments of the outer function.

A

Function factories

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

Data encapsulation and private methods don’t exist natively in JavaScript but can be emulated with ______ for data restriction and limited access.

A

closures

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