Created
December 2, 2021 09:37
-
-
Save Chojiu15/97f0f3f09305827fee99cf088674b5b7 to your computer and use it in GitHub Desktop.
OOP
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Vehicule { | |
constructor(brand, color, km){ | |
this._brand = brand, | |
this._color = color, | |
this._km = km | |
} | |
brand(){ | |
console.log(this._brand) | |
} | |
// get brand(){ | |
// return this._brand | |
// } | |
// set brand(value){ | |
// this._brand = value | |
// } | |
} | |
let car = new Vehicule('BMW', 'black', '100K') | |
let car2 = new Vehicule('Fiat', 'blue', '200k') | |
car.brand() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment