JavaScript Modules Named Exports


#1

The instructions for part 7 of Named Exports reads as follows:
“In the body of the meetsStaffRequirements() function, write logic to check if the length of the availableStaff array is greater than or equal to requiredStaff.”

Here is my current code:

let availableAirplanes = [
{
  name: 'AeroJet',
  fuelCapacity: 800,
  availableStaff: ['pilots', 'flightAttenendants', 'engineers', 'medicalAssistance', 'sensorsoperators']
 }, 
 {
   name: 'SkyJet',
  fuelCapacity: 500,
  availableStaff: ['pilots', 'flightAttenendants']
 }
];

let flightRequirements = {
  requiredStaff: 4,
  
}

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

The error message with the fail is “Does the function return false when availableStaff is equal to requiredStaff?”

Since I have it set to >= it should return True when equal to.

Link to the lesson:
Named Exports


#2

look at requiredStaff, is it an array?


#3

Thanks,

I was at a stoplight when I read your response and immediately realized I had used .length on both.