I\'m bashing my head against an error I can\'t work out how to fix. I have the following;
JSON
{\"products\":
[
{
\"product_id\" : \"123
If you want to map an object you can use Lodash. Just make sure it's installed via NPM or Yarn and import it.
With Lodash:
Lodash provides a function _.mapValues to map the values and preserve the keys.
_.mapValues({ one: 1, two: 2, three: 3 }, function (v) { return v * 3; });
// => { one: 3, two: 6, three: 9 }