Task - Object-oriented Programming #15
Replies: 4 comments
|
class Car { } let audi = new Car("blue", "A7", 2020); audi.displayDetails() |
|
`'user strict'; class Car { get color() { set color(newColor) { get model() { set model(newModel) { get year() { set year(newYear) { displayDetails() { function createObject() { |
|
class Car { } MG.displaydetail() |
|
Code of class car: } var myCar = new Car('Ford', 'Gold', 2009); console.log(myCar.getColor); var mercedes = new Car('Mercedes ML', 'white', 2012); |

Uh oh!
There was an error while loading. Please reload this page.
Write a class 'Car' which has the following attributes:
Write getters and setters for all the fields.
Implement displayDetails() functions which will display all the properties of the car.
Create two different objects of car and print their details.
All reactions