vanillajs-deck/slides/165-classes-2.html

16 lines
289 B
HTML
Raw Normal View History

2020-01-28 21:41:29 +00:00
<title>Classes (2)</title>
<h1>Classes</h1>
<pre>
class square extends shape {
constructor() {
super(4);
}
}
const sq = new square();
// square.sides = 4;
const hex = sq.makeShape(6);
// error: static method isn't inherited
2020-01-29 18:26:00 +00:00
</pre>
<next-slide>170-es5-classes</next-slide>