Why is this not working?

let spaceship = {
  'Fuel Type' : 'Turbo Fuel',
  homePlanet : 'Earth'
};

// Write your code below
let greenEnergy = spaceship => {
  spaceship['Fuel Type'] = 'avocado oil';
};
let remotelyDisable = spaceship => {
  spaceship.disabled = true;
};

spaceship.greenEnergy();
spaceship.remotelyDisable();
console.log(spaceship);
let spaceship = { 'Fuel Type' : 'Turbo Fuel', homePlanet : 'Earth' }; // Write your code below let greenEnergy = spaceship => { spaceship['Fuel Type'] = 'avocado oil'; }; let remotelyDisable = spaceship => { spaceship.disabled = true; }; spaceship.greenEnergy(); spaceship.remotelyDisable(); console.log(spaceship);

Why is this not working?

let spaceship = { 'Fuel Type' : 'Turbo Fuel', homePlanet : 'Earth' }; // Write your code below let greenEnergy = spaceship => { spaceship['Fuel Type'] = 'avocado oil'; }; let remotelyDisable = spaceship => { spaceship.disabled = true; }; spaceship.greenEnergy(); spaceship.remotelyDisable(); console.log(spaceship);

Hey courseplayer71626!

You declared two arrow functions that need one parameter each:

let greenEnergy = spaceship => {
  spaceship['Fuel Type'] = 'avocado oil';
};
let remotelyDisable = spaceship => {
  spaceship.disabled = true;
};

However when you later call them, you do it in the wrong way and you haven’t provided any parameter, this is the code corrected:

greenEnergy(spaceship);
remotelyDisable(spaceship);

Check this screenshot:
image

Does this help? :slight_smile:

1 Like

Thank you! much appreciated.

1 Like