lab13: impl
This commit is contained in:
15
lab13/rabbit.ts
Normal file
15
lab13/rabbit.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
// rabbit.ts
|
||||
|
||||
class Rabbit {
|
||||
name: string;
|
||||
|
||||
constructor(name: string) {
|
||||
this.name = name;
|
||||
}
|
||||
}
|
||||
|
||||
let myName: string = "Monty";
|
||||
let r: Rabbit = new Rabbit("Python");
|
||||
|
||||
console.log(r.name); // ERROR!!!
|
||||
console.log(myName); // Prints "Python"
|
||||
Reference in New Issue
Block a user