0
Hello. I have the following senary:
I have an array of objects as below.
var project = [
{partNumber: 1234, project: X19, gap: 30},
{partNumber: 1234, project: X19, gap: 40},
{partNumber: 5678, project: X09, gap: 10},
{partNumber: 5678, project: X09, gap: 20}
]
I need to access this array, separate it when partNumber and project are equal then add the gap value between them.
Example:
In the array I described, I have two objects with same partNumber: 1234 and project: X19 so I must add their gap resulting in 70. Then partNumber: 5678 and project: X09 summing up their gap, 30.
Can you help me?
What have you tried so far? What is your question?
– fernandosavio