typescript function return key value pair code example
Example 1: key value pairs typescript
var item: {[key: string]: number}
Example 2: typescript key value array
let indexedArray: {[key: string]: number}
let indexedArray: {[key: string]: number} = {
foo: 123,
bar: 456
}
indexedArray['foo'] = 12;
indexedArray.foo= 45;