Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
// source https://jsbin.com
"use strict";
var arr = [9, 4];
var myMap = new Map();
myMap.set("name", arr);
var newMap = new Map(myMap);
// newMap.set("name","shraddha")
arr.push(5);
myMap.forEach(function (value, key) {
console.log(key + " : " + value);
});
newMap.forEach(function (value, key) {
console.log(key + " : " + value);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment