Reputation: 1317
Let’s say we have a global variable defined as follows:
gContainer = {};
gContainer.person = {
name: "Jack",
last_name: "Tompson"
};
Are its properties global too? I mean, is person
global too?
Upvotes: 0
Views: 33
Reputation: 172518
Are its properties global too? I mean, is person global too?
No. gContainer.person
is a property to an object not a global variable
Upvotes: 1
Reputation: 225054
No. The term “global” only applies to variables, and gContainer.person
is not a variable; it’s a property of an object.
Upvotes: 5