formations/javascript/base/es6-2.md

26 lines
290 B
Markdown
Raw Permalink Normal View History

# .cadoles-slide-title[Le futur (proche): ES6 (2/4)]
**Écriture simplifiée des classes**
```js
class Animal {
constructor(hasFur) {
this.hasFur = hasFur;
}
}
class Dog extends Animal {
constructor() {
super(true);
}
bark() {
console.log('Woaf !');
}
}
```