Modules 6/15


#1

Can someone help me with this code please, why are their curly brackets in this line, in the forEach function? Airplane.availableAirplanes.forEach(function(){});

This is the whole code

import Airplane from ‘./airplane’;

function displayFuelCapacity () {
Airplane.availableAirplanes.forEach(function()
{});
};


#2

Never mind, think I have realised why. The curly brackets serve as the body to the newly created forEach function within the variable.


#3

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