1var myObject = { 'a': 1, 'b': 2, 'c': 3 };
2
3Object.keys(myObject).map(function(key, index) {
4 myObject[key] *= 2;
5});
6
7console.log(myObject);
8// => { 'a': 2, 'b': 4, 'c': 6 }
1var myObject = { 'a': 1, 'b': 2, 'c': 3 };
2
3for (var key in myObject) {
4 if (myObject.hasOwnProperty(key)) {
5 myObject[key] *= 2;
6 }
7}
8
9console.log(myObject);
10// { 'a': 2, 'b': 4, 'c': 6 }