I just have one key, that I am passing from MAP to...
# suitescript
t
I just have one key, that I am passing from MAP to reduce, still, reduce is getting called 2 times. What am I missing?
It’s not because two items in values array for sure, I have tried with 10 items, it still runs two times.
My understanding says, it should run once, since we have one key.
b
that only looks like it ran once
you can write the same key in a map to group multiple values together
the reduce will still only run once for that key, but will have multiple values
t
Yeah, sorry battk, I am so dumb, I put two logs for the same and thought it ran twice.
However, thanks a lot for your help.