FAQ: Objects - Pass By Reference


This community-built FAQ covers the “Pass By Reference” exercise from the lesson “Objects”.

Paths and Courses
This exercise can be found in the following Codecademy content:

Web Development

Introduction To JavaScript

FAQs on the exercise Pass By Reference

There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply (reply) below.

If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.

Join the Discussion. Help a fellow learner on their journey.

Ask or answer a question about this exercise by clicking reply (reply) below!

Agree with a comment or answer? Like (like) to up-vote the contribution!

Need broader help or resources? Head here.

Looking for motivation to keep learning? Join our wider discussions.

Learn more about how to use this guide.

Found a bug? Report it!

Have a question about your account or billing? Reach out to our customer support team!

None of the above? Find out where to ask other questions here!


What’s the difference between a spaceship object and the spaceship variable. In lesson 8 of objects, the lesson talks about a function that receives a parameter of spaceship, but apparently the obj is a pointer to the spaceship object, not the spaceship variable, causing the function to be useless.


A variable is not a value and an object is not a pointer, what you’re saying doesn’t add up.
A variable is a name that can hold on to a reference. References are hidden from you, you can’t interact with them. It just means that variables are not storage, instead they know where the value is stored.
An object is a value.

You can think of variables as names pointing into memory. When you assign a variable you are changing where it points. When you read from a variable you read the object, the dereferencing is done by the language, you can’t see the references themselves.