Check out example codes for "typescript key value array". It will help you in understanding the concepts better.

Code Example 1

var item: {[key: string]: number}

Code Example 2

let indexedArray: {[key: string]: number}

let indexedArray: {[key: string]: number} = {
    foo: 123,
    bar: 456
}

indexedArray['foo'] = 12;
indexedArray.foo= 45;

Learn ReactJs, React Native from akashmittal.com