How can I synthesize this?

Hello, this is the exercise I’m talking about:
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}

// 'This is pita bread'
// 'This is french bread'
1 Like