I have an object:
myObject = { 'a': 1, 'b': 2, 'c': 3 }
I'm seeking for a native method that works like Array.prototype. This is a map that might be utilised as follows:
newObject = myObject.map(function (value, label) {
return value * value;
});
// newObject is now { 'a': 1, 'b': 4, 'c': 9 }
Is there a map method for objects in JavaScript? (I want this for Node.JS, so I'm not concerned about cross-browser compatibility.)