use of map instad of for loop
for i in object:
doSomething(i)
////////////////////////////////
map(doSomething, object)
use of map instad of for loop
for i in object:
doSomething(i)
////////////////////////////////
map(doSomething, object)
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