Skip to content

Instantly share code, notes, and snippets.

@Chojiu15
Created December 2, 2021 09:37
Show Gist options
  • Save Chojiu15/97f0f3f09305827fee99cf088674b5b7 to your computer and use it in GitHub Desktop.
Save Chojiu15/97f0f3f09305827fee99cf088674b5b7 to your computer and use it in GitHub Desktop.
OOP
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