Skip to content

Instantly share code, notes, and snippets.

@haidarafif0809
Last active March 31, 2018 11:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save haidarafif0809/6eadf0f5d20e227a626083f37a826f34 to your computer and use it in GitHub Desktop.
Save haidarafif0809/6eadf0f5d20e227a626083f37a826f34 to your computer and use it in GitHub Desktop.
class Car {
constructor(type, color) {
this.type = type
this.color = color
this.engineStatus = 'off'
}
engineStart () {
this.engineStatus = 'on'
console.log('engine start')
}
engingeStop () {
this.engineStatus = 'off'
console.log('engine start')
}
static isEngineOn (car) {
if (car.engineStatus === 'on') {
console.log('Engine On')
} else {
console.log('Engine off')
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment