FAQ: Intermediate JavaScript Modules - Named Imports

Community%20FAQs%20on%20Codecademy%20Exercises

This community-built FAQ covers the “Named Imports” 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 Named Imports

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!

Did anyone try to use string interpolation instead of string concatenation to log ?

5 Likes

Yes, I get the exact same output but the exercises in this section will not accept string interpolation as correct for any of them it seems.

3 Likes

Me too. And I couldn’t pass the check using interpolation… until I modified the log message using concatenation.

Suppose I imported a function/object (named as AAA, for example) into my current .js file.
Can I create a different function/object, also named AAA, in the current .js file?

Does it cause an error? Or is it not considered the best practice even though we can do so?

I guess this may have something to do with how we should do function/object naming when writing code, right?

Can I import from files that are not .js ?

to the question, can I overwrite an imported function? I tried different things. Seems in Javascript changing a function is possible (unless you define it with const) but in this Codecademy exercise it is not. Try it out yourself!

1 Like

improper grading for ES6 syntax. This entire lesson for modules has been riddled with poor compatibility with ES6 syntax.

1 Like

fails with string interpolation… this lesson is riddled with bugs…

1 Like

It seems like some of the compatibility issues have been resolved, but not all of them.

One of the earlier exercises let me use template strings, and then I saw some comments that, for others, this had thrown an error.

However, just having completed exercise 8, it wouldn’t let me pass from Task 4 to 5 unless I used function declaration syntax instead of an arrow function i.e.

function displayStaffStatus() {

};

instead of

const displayStaffStatus = () => {

};

This is particularly confusing and inconsistent, because in a previous exercise it had let me use arrow function syntax for the displayFuelCapacity() function, which appears earlier in the same piece of code (in the same file)!

You are right that there are lots of bugs in this lesson: have you (or anyone else) reported this issue and some of the specific bugs via the designated Bug Report form?

For anyone who doesn’t know how to do this: from any lesson, click Get Help in the bottom right of screen, then select Bugs from the drop-down).
Here’s a link to instructions about how to do it:
https://help.codecademy.com/hc/en-us/articles/220711148-Report-a-Bug-or-Typo
Note: you must include the URL of the relevant exercise in the description field.

As someone who is currently working through this lesson, I do get the feeling that improvements are being made. However, it is definitely still a work-in-progress, so by submitting bug reports we’ll hopefully speed this up and make things less frustrating for those that follow! :+1: :smiley:

2 Likes

A lot of the exercises at this point seem to require the semicolon to pass through the exercise. I haven’t been using it since the beginning of the path began by explaining ES6.

2 Likes

Has anybody been able to run the code in exercises 7 and 8 ( airplane.js and missionControl.js using named exports ) using node ? I haven’t been able to even after transpiling it with babel. is named export syntax so new that even babel can’t transpile it ?

You have to insert the semicolon where necessary.
It’s really frustrating though :tired_face:

Why doesn’t this exercise and some previous ones accept ${template literals} or “double quotation marks” in the answer?

I had the same issue with arrow function notation, however, this happened to me within different steps of the SAME lesson! It’s so frustrating because I was marked as correct for defining an empty function using arrow notation, and then marked incorrect for passing an arrow notation function through a .forEach() method.

I ended up passing through the code they gave in the hints and that worked, but I saved my other two attempts in order to show what wasn’t accepted. It was interesting because I changed how I notated the function for the .forEach() method, but got marked wrong for the initial arrow function notation which had previously been accepted.

Here’s a link to the code for clarity:

1 Like

It’s been a while since I did this lesson, but I think I remember also trying to use arrow function syntax for the callback function within the .forEach() iterator, just like you have. Again, I think it was marked as incorrect, when it clearly shouldn’t be.

I also remember having an initial empty arrow function marked as correct, only for it to trigger incorrect when the .forEach() iterator was added within it. And I’m pretty sure, just like you, I thought it was caused by using arrow function syntax within .forEach(), but in the end discovered that it was the previously accepted (then unaccepted) initial arrow function!!

My original post only included a small sample of the problems I encountered with this lesson…

:crazy_face:

If you feel inclined, and have the time, then I think it would be a good idea to send a bug report to @alexcraig, in the format he asks for here :wink:

Seems like there are still issues with this lesson…

2 Likes

Wow, you explained this so much better than I did! But yes, that’s exactly what happened. It’s nice to hear that someone else gets it. I’ve reported it as a bug, but since it seems like others have done so months ago without much luck, I’ve also sent out an email asking for help. I’ve found that Codecademy generally responds and fixes bugs if you reach out to them through email. I don’t know if anything ever comes of bug reports–it certainly doesn’t seem like it, but maybe I’m just impatient.

1 Like

@alexcraig has offered a “fast-track” for bug reports, if they are submitted to him in the format he asks for here. That’s different to submitting them via the link in the actual lessons. But, hey, if you’ve had success by sending emails (to Support?) then that’s great! :+1: :smiley:

1 Like

Well, they’ve yet to get back to me this time around. It also seems like @alexcraig mentioned back in August that the issue should get fixed in a week or two but it’s been a couple of months. I appreciate Codecademy, but I’ve found the inconsistencies and the inability to be taken seriously when you find those inconsistencies to be beyond frustrating. What’s worse is that I’m still learning myself so I automatically think I’m at fault and waste a bunch of time trying to fix problems unrelated to me.

Hi @kgnunn999 do you have the link to where I said that? All the bug reports I’ve submitted seem to be fixed. I’ll chase up for you if you point me to it.