2014-11-11 20:31:45 +01:00
|
|
|
//// [objectLiteralShorthandPropertiesFunctionArgument.ts]
|
|
|
|
var id: number = 10000;
|
|
|
|
var name: string = "my name";
|
|
|
|
|
|
|
|
var person = { name, id };
|
|
|
|
|
|
|
|
function foo(p: { name: string; id: number }) { }
|
|
|
|
foo(person);
|
|
|
|
|
|
|
|
|
|
|
|
var obj = { name: name, id: id };
|
|
|
|
|
|
|
|
//// [objectLiteralShorthandPropertiesFunctionArgument.js]
|
|
|
|
var id = 10000;
|
|
|
|
var name = "my name";
|
2015-03-09 02:23:23 +01:00
|
|
|
var person = {
|
|
|
|
name: name,
|
|
|
|
id: id
|
|
|
|
};
|
|
|
|
function foo(p) {
|
|
|
|
}
|
2014-11-11 20:31:45 +01:00
|
|
|
foo(person);
|
2015-03-09 02:23:23 +01:00
|
|
|
var obj = {
|
|
|
|
name: name,
|
|
|
|
id: id
|
|
|
|
};
|