Thanks a lot, works like a charm. I also get flatten and group by now. One last question to fully understand the code:
For totalPrice["values"][totalPrice.length]
.
I guess totalPrice["values"]
gets all the values in the array.
And we use totalPrice.length
because the length is 2, but the index starts at 0 so we insert a new element after the second (or last in any other case) element in the array right?