typescript dictionary get value by key code example
Example 1: typescript for loop key value pai
for (let key in myDictionary) {
let value = myDictionary[key];
// Use `key` and `value`
}
Example 2: js dictionary to extract the same key bvalues
const car = [{id: "1", brand: "Opel"}, {id: "2", brand: "Haima"},{id: "3", brand: "Toyota"}];
const brands = car.map(({ brand }) => brand);