I have an object:
myObject = { 'a': 1, 'b': 2, 'c': 3 }
I'm trying to find a native method that works like Array.prototype. The following is a map that would be used:
newObject = myObject.map(function (value, label) {
return value * value;
});
// newObject is now { 'a': 1, 'b': 4, 'c': 9 }
Does JavaScript have a similar object map function? (I don't care about cross-browser compatibility because I want this for Node.JS.)