Interface for associative object array in TypeScript Interface for associative object array in TypeScript typescript typescript

Interface for associative object array in TypeScript


Yes, you can use an index signature:

interface MyType {    [key: string]: string | boolean | number;}var obj: MyType = {    key1: "apple",    key2: true,    key3: 123};