1.

How to create an object in typescript?

Answer»

In Typescript, an object is USED to store a set of key-value pairs. FOLLOWING is a syntax for CREATING an object in Typescript:

Example

VAR object_name = {
    key1: “value1”,
    KEY2: “value”,
    key3: function() {
    },
    key4:[“content1”, “content2”]
};



Discussion

No Comment Found