Import Named Imports : bug in codecademy compiler?


#1

Hello, I’m in the middle of this lesson. I ran into an issue that has shaken my confidence a bit in the codecademy compiler’s ability to check my work. Perhaps I need to avoid a behavior?

originally I had:

// step 2
function displaySpeedRangeStatus() {
	// step 3
  availableAirplanes.forEach(function(element){});
}

The above wouldn’t work and as a result, i couldn’t get a green check box on // step 3. The error i got was “Did you call forEach() on availableAirplanes?”. As a result, i pasted the hint provided in the tutorial over my code.

function displaySpeedRangeStatus() { 
  availableAirplanes.forEach(function(element){});
}

It worked fine. I feel like I found a bug. Regardless, i added my // step 2 and // step 3 comments back in and it continued to work fine. Is it possible that the compiler doesn’t like spaces or something after lines or // comments? I want to avoid funky issues like this because once you get it right, it should determine this otherwise the student (me) starts trying things that won’t work due to thinking they still don’t have it correct.

I ran into exactly the same issue in step 4. I type it in correctly. it didn’t work. I pasted in the hint which is exactly the same visible syntax that I typed in and it works. Am I going crazy?


#2

It’s quite possible that the SCT does not like unexpected comments. The best time to comment is when the lesson steps have all passed and the Next button is lit. Then you can comment and Run again without affecting the checkmarks. The Next button will still be waiting.

If this leads to issues down the road, then the other optiion is go back through the whole module after it is completed and a do a review of the lessons, and annotate all you wish at that point. Be sure to Run so the code is saved. Don’t use Next to browse lessons. Use the sidebar menu.


#3

got it. I’ll try that. thanks.