From the course: Learning the JavaScript Language
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Jargon: References - JavaScript Tutorial
From the course: Learning the JavaScript Language
Jargon: References
- [Instructor] When working with JavaScript objects, there's an important concept called references. Objects are references to particular locations in the computer's memory and that impacts your ability to work with them in different contexts. So let's create an animal object one more time and check its value. I'm going to copy everything from the start of this file into Node, and now when I check the value, I can see everything looks right. Now I'm going to create another variable called animal2 and assign animal to it. If I inspect animal2, it's all the same stuff. Now the question here is, what have I actually done when I executed that assignment statement? Did I make a copy of the animal object? As we will see the answer turns out to be no. To demonstrate this, let's change animal2's genus to ursus, a bear. So now when I inspect animal2, I see that the genus has been set to ursus, which is what I expect, but if I…
Contents
-
-
-
-
-
Objects4m 13s
-
(Locked)
Using objects for data modeling2m 33s
-
(Locked)
Manipulating objects4m 24s
-
(Locked)
Jargon: References4m 39s
-
(Locked)
Arrays5m 35s
-
(Locked)
Manipulating arrays7m 36s
-
(Locked)
Readability: Whitespace3m 24s
-
(Locked)
Readability: Comments4m 57s
-
(Locked)
Regular expressions6m 9s
-
-
-
-
-
-