FAQ: Intermediate JavaScript Modules - module.exports II


This community-built FAQ covers the “module.exports II” exercise from the lesson “Intermediate JavaScript Modules”.

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

Web Development

Introduction To JavaScript

FAQs on the exercise module.exports II

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!


The line 1 of 2-airplane.js is unnecessary. We export an anonymous object and in that line we are creating an empty object stored in the variable Airplane. The two objects have no relation. And we can store the module object in a variable named Airplane in the 2-missionControl.js file with require() and call the properties and methods in that variable Airplane.


This was the exact reason for me looking into the forum today lol. Thanks!

1 Like

Same! Thanks :slight_smile:

1 Like

Same here - it’s very confusing for a beginner.

Am I correct in saying that they should have put “Menu.” in front of each of the properties in the example? Then it would make sense and you export “Menu”. Or as stated here, don’t define an object and then subsequently export an anonymous object.


Absolutely right with my thinking


I was looking for the confirmation of my doughts about the first line too. Thanks.


Thank you for posting this. I was very also very confused about this being a beginner.


it would be great if someone from Codecademy could weigh in here. We all seem to agree in this thread that line 1 is unneccessary. Why is it there?