1

I am trying to use for-of loop for my map which look something like this

var map = new Object();
map["myKey1"] = "myVal";
map["myKey2"] = "myVal";

for (let [key, value] of map) {
  console.log(key + ' is ' + value);
}

but I am getting TypeError: map[Symbol.iterator] is not a function

Please suggest solution for this.

0

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.