Sha256: f50f33c16666ad19610b3114a2cf7c2d4ff1d4938c26f2b86f470e4e19054183
Contents?: true
Size: 535 Bytes
Versions: 18
Compression:
Stored size: 535 Bytes
Contents
class Animal { constructor(public name) { } move(meters) { alert(this.name + " moved " + meters + "m."); } } class Snake extends Animal { constructor(name) { super(name); } move() { alert("Slithering..."); super.move(5); } } class Horse extends Animal { constructor(name) { super(name); } move() { alert("Galloping..."); super.move(45); } } var sam = new Snake("Sammy the Python") var tom: Animal = new Horse("Tommy the Palomino") sam.move() tom.move(34)
Version data entries
18 entries across 18 versions & 5 rubygems