Lesson 10: Intermediate Javascript Modules - IMPORT NAMED IMPORTS


#1

Hi Guys,

I need someone to help explain something real quick please. I am on the Lesson 10: Intermediate Javascript Modules - IMPORT NAMED IMPORTS now and I am doing everything right and progressing well but something just doesnt makes sense to me.

For the following code, I am using the ‘element’ parameter of the function with every ‘variable’ except for the following:

function displaySpeedRangeStatus() {
  availableAirplanes.forEach(function(element) {
    console.log(element.name + 'meets speed range requirements: ' + meetsSpeedRangeRequirements(element.maxSpeed, element.minSpeed, flightRequirements.requiredSpeedRange));
  });
}
flightRequirements.requiredSpeedRange --->??? 

For this part of the code, I don’t understand why I cannot use element and instead I have to use ‘flightsRequirements’ which is a variable declared in a seperate sheet and has been imported here.

The other variables are also imported similar to the above but they work fine with element.thenthevariable…

Thanks in advance.


#2

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.