iterate over map key value javascript
recipeMap.forEach((value, key) => {
console.log(`${key} costs ${value}`);
});
iterate over map key value javascript
recipeMap.forEach((value, key) => {
console.log(`${key} costs ${value}`);
});
how to loop through a map in js
var myMap = new Map();
myMap.set("0", "foo");
myMap.set(1, "bar");
myMap.set({}, "baz");
for (const [key, value] of Object.entries(myMap)) {
console.log(key, value);
}
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us