Answers for "loop through object typescruipt"

3

loop through object typescript

// This solution is for when you want to use 
// `break`, `return` which forEach doesn't support
for (const key in tempData) {
      if (tempData.hasOwnProperty(key)) {
        // your logic here
      }
}
Posted by: Guest on August-11-2020
1

tepescript loop object

function foo(abc: ABC) {
  let k: keyof ABC;
  for (k in abc) {  
    const v = abc[k];  
  }
}
Posted by: Guest on December-31-2021

Code answers related to "TypeScript"

Browse Popular Code Answers by Language