Answers for "typescript for loop key value pai"

4

object iteration in typescript

Object.entries(obj).forEach(
  ([key, value]) => console.log(key, value);
);
Posted by: Guest on July-21-2020
0

typescript key value loop

//< ES 2017:

Object.keys(obj).forEach(key => {
  let value = obj[key];
});

//>= ES 2017:

Object.entries(obj).forEach(
  ([key, value]) => console.log(key, value);
);
Posted by: Guest on September-24-2020
0

typescript for loop key value pai

for (let key in myDictionary) {
    let value = myDictionary[key];
    // Use `key` and `value`
}
Posted by: Guest on October-15-2020

Code answers related to "TypeScript"

Browse Popular Code Answers by Language