Learn how objects are passed by reference into functions.
- [Instructor] In this video we're going to talk…about objects and functions.…How objects are passed by reference into functions…and what that means.…So to start off, let's look at this object.…It's called Calvin, and it has this form.…Its name is Calvin, its best friend is Hobbes,…and its form is human boy.…Now along with this object I have a function I've written,…which is the transmogrifier.…And what this does is it takes a Calvin…and transforms its form into something else.…So let's try running this.…
So I can see now that the form has been changed…into tyrannosaurus from human boy.…Let's look at the definition of this function.…And here it is.…It accepts a Calvin object, and then we do…a little bit of type checking…to make sure that the argument is at least…something like we expect it to be.…When you're writing functions, it's a good idea…to make sure that the input that you're accepting…into the function is of a structure that you expect.…Otherwise your code could later break down…and you'd have a lot of debugging to do.…
- Using a text editor
- Declaring and assigning variables
- Booleans and the quest for truth
- Working with objects and arrays
- Using operators and control structures
- Iterating with loops
- Objects, references, and functions
- Promises, async, and await
Skill Level Beginner
1. Getting Started
2. Variables and Types
3. Objects, Arrays, and More
4. Operators and Control Structures
5. Iterating with Loops
7. More Advanced Pieces
Next steps3m 38s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.