From the course: Learning the JavaScript Language
Unlock the full course today
Join today to access over 24,700 courses taught by industry experts.
Objects, references, and functions - JavaScript Tutorial
From the course: Learning the JavaScript Language
Objects, references, and functions
- [Instructor] In this video, we're going to talk about objects and functions, how objects are passed by reference into functions, and why we need to pay attention to that fact. To start off, let's look at this object. It's called calvin. And it has this form, a property called name which is Calvin, bestFriend is Hobbes, and it takes the form of a human boy. Along with this object, I have a function I've written which is called the transmogrifier. This function can take a calvin object and transform it into something else. If it sounds like I'm talking absolute nonsense when I say this, I recommend reading the wonderful comic books Calvin and Hobbes by Bill Watterson. It's fun for all ages. Anyhow, let's take a look at how this function works. I'm going to pass in this calvin. And then I'm going to look at the object again. And I can see that Calvin has been transformed from a human boy into a grey wolf. Let's…
Contents
-
-
-
-
-
-
-
-
(Locked)
Basic functions4m 20s
-
(Locked)
Arguments and parameters in functions6m 54s
-
(Locked)
More on function arguments5m 3s
-
(Locked)
Objects, references, and functions7m 4s
-
(Locked)
Functions are objects5m 8s
-
(Locked)
Jargon: Scope in JavaScript2m 30s
-
(Locked)
Functions and scope5m 11s
-
(Locked)
Writing shorter functions with arrows3m 12s
-
(Locked)
Three little dots collect the rest4m 14s
-
(Locked)
Callback functions and looping4m 34s
-
(Locked)
-
-