Answers for "typescript iterate over interface"

1

ts iterate over interface properties

class Activity {
    public id: string = '';
    public title: string = '';
    public body: string = '' ;
    public json: Object = {};
}

let activity = new Activity()

const headers: Array<Object> = Object.keys(Activity).map(key => {
    return { text: key, value: key }
});

console.log(JSON.stringify(headers))
Posted by: Guest on July-20-2020
0

typescript iterate over interface

(Object.keys(newResources) as Array<keyof Resources>).forEach(...)
Posted by: Guest on June-01-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language