var myCar = {
name: 'bmw',
drive: function() {
console.log('I am driving!');
},
panic: function() {
console.log('wait, how do you stop this thing?');
}
};
//Usages:
var youcar = Object.create(Car);
console.log(yourcar.name); //'bmw'
I guess it should be var Car or create(MyCar)
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
var myCar = {
name: 'bmw',
drive: function() {
console.log('I am driving!');
},
panic: function() {
console.log('wait, how do you stop this thing?');
}
};
//Usages:
var youcar = Object.create(Car);
console.log(yourcar.name); //'bmw'
I guess it should be var Car or create(MyCar)