In my array list, I have a collection of values structured as follows:
"data": {
"input": [
{ "weight": 'KG', "Amt": 40 },
{ "weight": 'KG', "Amt": 20.25 },
{ "weight": 'KG', "Amt": 10.30 }
]
}
How can I determine if all three records in the above list have the same weight using typescript? The weight is not constant but varies each time we receive the list.
"data": {
"input": [
{"weight":'', "Amt": 40},
{"weight":'KG',"Amt": 20.25},
{"weight":'Gram',"Amt": 10.30}
{"weight":'KG',"Amt": 10.30}
]
}
If all records in the list have the same weight, I need to return true.