const engine = {
type: "V8",
displacement: 4.0,
getInfo() {
return `${this.type} - ${this.displacement}L`;
},
turbo: {
boost: 12,
getBoost() {
return `${this.type ?? "Unknown"} boosted at ${this.boost} psi`;
},
},
};
const detached = engine.getInfo;
const turboInfo = engine.turbo.getBoost;
console.log(engine.getInfo());
console.log(engine.turbo.getBoost());
console.log(turboInfo()); Post #3051
2.66K
CHALLENGE
- ❤ 7
- 🔥 5