mirror of
https://github.com/fluencelabs/assemblyscript
synced 2025-04-25 07:02:13 +00:00
Essentially, if the contextual type is a class with a constructor that takes zero arguments or doesn't have a constructor at all, an object literal can be used to initialize a new instance of that class with preset values.
10 lines
86 B
TypeScript
10 lines
86 B
TypeScript
var obj = {
|
|
a: 123,
|
|
b: "234",
|
|
"c": false,
|
|
d: {
|
|
a: 123,
|
|
"b": {}
|
|
}
|
|
};
|