10 lines
271 B
TypeScript
10 lines
271 B
TypeScript
//// [contextualTyping12.ts]
|
|
class foo { public bar:{id:number;}[] = [{id:1}, {id:2, name:"foo"}]; }
|
|
|
|
//// [contextualTyping12.js]
|
|
var foo = (function () {
|
|
function foo() {
|
|
this.bar = [{ id: 1 }, { id: 2, name: "foo" }];
|
|
}
|
|
return foo;
|
|
}());
|