[SOLVED] 11. Modules Exercise 13 - Combining Export Statements


#1

When attempting Instruction 1, I receive the following failure message:
Did you export availableAirplanes …”. My code is as follows:

export let availableAirplanes = [
    {
    name: 'AeroJet',
    fuelCapacity: 800,
    availableStaff: [
     'pilots', 'flightAttendants', 'engineers', 'medicalAssistance', 'sensorOperators'],
    maxSpeed: 1200,
    minSpeed: 300
    },
    {
    name: 'SkyJet',
    fuelCapacity: 500,
    availableStaff: [
    'pilots', 'flightAttendants'],
		maxSpeed: 800,
    minSpeed: 200
    }
  ]

export let flightRequirements = {
  requiredStaff: 4,
  requiredSpeedRange: 700
}

export function meetsStaffRequirements(availableStaff, requiredStaff){
  if (availableStaff.length >= requiredStaff) {
    return true;
  }
  else {
    return false; 
  }
};

function meetsSpeedRangeRequirements(maxSpeed, minSpeed, requiredSpeedRange){
  let range = maxSpeed - minSpeed;
  if (range > requiredSpeedRange) {
    return true;
  }
  else
    return false;
}

export { meetsSpeedRangeRequirements as meetsSpeedRangeReqs };

I cannot see what is wrong and why I would receive that message. I had no choice but to hit the Solution key. The Solution code is as follows:

export let availableAirplanes = [
{name: 'AeroJet',
 fuelCapacity: 800,
 availableStaff: ['pilots', 'flightAttendants', 'engineers', 'medicalAssistance', 'sensorOperators'],
 maxSpeed: 1200,
 minSpeed: 300
}, 
{name: 'SkyJet',
 fuelCapacity: 500,
 availableStaff: ['pilots', 'flightAttendants'],
 maxSpeed: 800,
 minSpeed: 200
}
];

export let flightRequirements = {
  requiredStaff: 4,
  requiredSpeedRange: 700
};

export function meetsStaffRequirements(availableStaff, requiredStaff) {
  if (availableStaff.length >= requiredStaff) {
    return true;
  } else {
    return false;
  }
};

export function meetsSpeedRangeRequirements(maxSpeed, minSpeed, requiredSpeedRange) {
  let range = maxSpeed - minSpeed;
  if (range > requiredSpeedRange) {
    return true;
    } else {
    return false;
  }
};

export default meetsSpeedRangeRequirements;

I think this is a bug as I have correctly exported the required objects for Instruction 1 and was unable to progress to Instruction 2.


#2

Solved it. I was missing a ; at the end of my availableAirplanes array and flightRequirements object.

However, I would say the error received is misleading.