I have two objects
object1 = {num: 0, num2: 0}
object2 = {num: 3, num2: 0}
I would like to compare both objects and get the highest one per object key, so my end results should be
result = {num: 3, num2: 0}
or if I had
object1 = {num: 0, num2: 0}
object2 = {num: 100, num2: 15}
I should get
result = {num: 100, num2: 15}
The highest math value per key.
The goal is to go through each object key comparing the two objects and pulling the highest numbered one. Per key also "num" is a var it can be anything and there could be more than two for example "num", "num1", "num2", "num3" and so forth.