Task - Object-oriented Programming #15
Replies: 4 comments
-
class Car {
} let audi = new Car("blue", "A7", 2020); audi.displayDetails() |
Beta Was this translation helpful? Give feedback.
-
`'user strict'; class Car { get color() { set color(newColor) { get model() { set model(newModel) { get year() { set year(newYear) { displayDetails() { function createObject() { |
Beta Was this translation helpful? Give feedback.
-
class Car {
} MG.displaydetail() |
Beta Was this translation helpful? Give feedback.
-
Code of class car:
} var myCar = new Car('Ford', 'Gold', 2009); console.log(myCar.getColor); var mercedes = new Car('Mercedes ML', 'white', 2012); |
Beta Was this translation helpful? Give feedback.
-
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.
Beta Was this translation helpful? Give feedback.
All reactions