FAQ: Intermediate JavaScript Modules - Combining Import Statements

This community-built FAQ covers the “Combining Import Statements” 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 Combining Import Statements

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!

Besides exporting/importing objects/functions/… from other js files, can we reuse code by citing the code sources in <script src="..."> in the html file, like what we do to use a JavaScript library?

If both ways are feasible, I’m curious about which is recommended and why. :smiley:

2 Likes

this chapter was complete garbage, I’m gonna mention that half of units didn’t worked. The biggest issue I have, you didn’t tell how to setup environment in which those import-exports would work, it has 0 value in real world projects ! Thanks for wasting 2,5 hr of my life, now back to MDN&udemy!

15 Likes

I had a similar experience.

3 Likes

Codecademy, these chapters read like:

“Write 1”

“Ok, now delete 1 and write 2”

“Ok, now delete 2 and write 1 again”

“Ok, now delete 1, and write 3”

“Ok, now delete 3, and write 1 again”

“Conclusion, you can write either 1, 2 or 3. Good Job!”

I am starting to doubt the usefulness of this endeavour…

20 Likes

These activities are really poorly made.

8 Likes

I have a question regarding this chpater

import { specialty, isVegetarian, isLowSodium } from ‘./menu’;
2.
import GlutenFree from ‘./menu’;

Question : why are we using a different statement to import 2, and not using it as 1

Question: Also I noticed in one of the earlier chapter it says you can import with alias name without actualy using “as” keyword but directly putting Alias name,. Now this even though it works on codeacademy exercise, I did not read it this way when I go to cheatsheet. Can someone explain, below is an excerpt from the chapter :
"To import named export aliases with the as keyword, we add the aliased variable in our import statement.

import { chefsSpecial, isVeg } from ‘./menu’;

BUT AS YOU CAN SEE THERE IS NO "AS " keyword above and they have put alias names

and this seemed to have worked in ione f the exercise. Am I missing something??

Please advise

Why is this wrong?

I spend more time trying to work out why my correct answers are rejected than actually learning.
I am grateful for a free trial of CodeAcemy due to COVID lockdown but right now I cannot see me shelling out for a paid sub once this free sub expires - which is a shame.

I learn much more at codewithmosh.com

2 Likes

I feel the same. no idea what I’m doing here, and how to re-use any of this knowledge.
Any link to useful ressources? I feel I missed the point here

4 Likes

I agree, this chapter had lots of false negatives: the exercise would fail if you, for example, missed a semi-colon: a ‘requirement’ that was never enforced in previous chapters, and that any JavaScript developer will agree is largely a matter of personal preference.

Another inconsistency was that one exercise allowed a callback function to be an arrow function whereas another failed if the callback function wasn’t declared with the ‘function’ syntax. Neither used the ‘this’ keyword and so the distinction is arbitrary: in fact, it is standard to declare callback functions using the arrow function syntax!

This module is in dire need of reviewing, I can imagine it would be very discouraging to have so many failed exercises when actually the code they’ve submitted does meet the criteria given.

4 Likes

I think you have a problem with the apostrophes you are using around the .js filename. I think you have to use the apostrophe from the US keyboard layout. I had the same problem in earlier exercises when I had my keyboard input set to International.

2 Likes

Definitely a complete waste of time, worst chapter I’ve gone through yet in codecademy

6 Likes

Yep, I agree this lesson was VERY frustrating regarding the syntax demanded to complete the exercices. On the final exercise (14/15) I had no other choice but to ask the solution of the exercise because the step 1 wouldn’t validate. As a result, it overwrote not only the code in this exercise but ALL the code I wrote myself in the past exercices of that lesson as well, and all the comments I had inserted to add valuable explanations (found on the forums) disappeared due to this. Thank you very much…

As a paying user I feel that this kind of mishap is not acceptable. Especially when I see that people have been complaining about this for 2 years and NOTHING has changed.

5 Likes

Lots of tedious, mindless busywork that does very little to exercise understanding of the concepts you’re supposed to be learning. This lesson needs to be completely revised in my opinion. I’ll take my medal for finishing it but I don’t think I gained much else.

3 Likes

The course has been great, up until modules. It needs to be scrapped or reworked. I really enjoy the content otherwise, not trying to be negative just providing feedback.

2 Likes

Agreed, very tedious and extremely frustrating chapter. Needs a rework for sure.

1 Like

Same here. Very frustrating few chapters. Spent my time using CTRL+H to find and replace text and that was it.