Open mhaidarhanif opened 5 years ago
const vehicle = {
drive() {
console.log(`Driving a ${this.maker} ${this.model} car!`)
},
sell() {
console.log(`Selling a ${this.maker} ${this.model} car!`)
}
}
const car = {
maker: 'Tesla',
model: 'S'
}
const bike = {
maker: 'Heboh',
model: 'BMX'
}
const driveCar = vehicle.drive.bind(car)
const driveBike = vehicle.drive.bind(bike)
const sellCar = vehicle.sell.bind(car)
driveCar()
driveBike()
sellCar()
Submit here.