How can I synthesize this?

Hello, this is the exercise I’m talking about: www.codecademy.com/courses/introduction-to-javascript/lessons/modules/exercises/export-default
How could I synthesize the properties name and fuelCapacity in order to not repeat the property for both objects?

let Airplane = {};
Airplane.availableAirplanes = [
  {
    name: 'AeroJet',
    fuelCapacity: 800
  }, 
  {
    name: 'SkyJet',
    fuelCapacity: 500
  }
];
export default Airplane; 

Thanks in advance.

Don’t know if this is what you want. I’ll write it anyway:

function description(){
  console.log(`This is ${this.type} bread`);
};

let pita = {type: "pita", description}
let baguette = {type: "french", description}

pita.description()
// 'This is pita bread'
baguette.description()
// 'This is french bread'
1 Like