06-30-2021 05:22 AM
Hello,
I have this json:
{
"a": "Hello Word",
"b": 1,
"c": "some",
"d": 10,
"nested": [{
"m": "hey",
"o": 10,
"p": "hello",
"q": 100
}]
}
I am trying to multiply each number field by 10 and the output structure needs to be the same.
So far I’ve managed to get it worked for an Object using: $.mapValues((value, key) => !isNaN(value) ? value * 10 : value)
but I don’t really know how can I do that for Arrays.
Any tips?
Thank you!
06-30-2021 06:40 AM
My pleasure @ionutbarna - glad you found your solution!