I have an array like this.And I want to know the maximum value of sequence.
array = [
{
"Id" : "123",
"Description" : "A Test 1",
"isSelected": true,
"Sequence" : 1
},
{
"Id" : "124",
"Description" : "C Test 2",
"isSelected": true,
"Sequence" : 2
},
{
"Id" : "125",
"Description" : "B Test 3",
"isSelected": true,
"Sequence" : 3
},
{
"Id" : "126",
"Description" : "Z Test 4",
"isSelected": true,
"Sequence" : 4
}
]
Now I want to find out Sequence with maximum value. In this case it will be 4. I need this value to match with the value user enters in the input. I tried Math.max but it was giving me undefined. Thank you for help.