Answers for "for loop dictionary in typescript"

2

iterate dictionary ts

for (const [key, value] of Object.entries(yourDictionary)) {
	console.log(`(${key}, ${value})`);
}
Posted by: Guest on August-31-2021
1

foreach on dictionary in typescript

Object.keys(dict).forEach(key=> {
  console.log(`key:${key}`, `val:${dict[key]}`);
});
Posted by: Guest on November-06-2021

Code answers related to "for loop dictionary in typescript"

Code answers related to "TypeScript"

Browse Popular Code Answers by Language