8. STRING / NUMBER / BOOLEAN
var name: string = 'Jan';
var age: number = 24;
var isDutch: boolean = true;
name = isDutch;
))*/F*)1 -/FÞ**' )ÞF/*FÞ./-$)Þ‡
14. CLASSES
class person implements IPerson {
public Name: string;
public Country: Countries;
public IsDutch: boolean;
constructor(name: string, country: Countries, isDutch: boolean) {
this.Name = name;
this.Country = Countries.Netherlands;
this.IsDutch = isDutch;
}
callName() {
return this.Name;
}
}
15. CLASSES - A SHORTER WAY
class person implements IPerson {
constructor(public Name: string, public Country: Countries,
public IsDutch: boolean) { }
callName() {
return this.Name;
}
}
16. NEW CLASS
var dave = new person('Dave Woestenborghs', Countries.Belgium, false);
17. GENERICS
function identityT(arg: T): T {
return arg;
}
var output = this.identitystring('one');
var output = this.identitystring(1);
0++'$ F+-( / -.F*F)*/F(/#F)4F.$)/0- F*!F''F/- /‰
*0'F)*/F++'4F/4+ FÞ./-$)ÞF/*F-0( )/FtF2#$#F$.F*!F/4+ FÞ)0( -Þ‡