I have array of objects in object have different key so i want the object having minimum value in that array
list = [
{
'id':4,
'name':'nitin',
'group':'angularjs'
},
{
'id':1,
'name':'nitin',
'group':'angularjs'
},
{
'id':2,
'name':'nitin',
'group':'angularjs'
},
{
'id':3,
'name':'nitin',
'group':'angularjs'
}]
I tried by
var minValue = Math.min.apply(Math, list.map(function (o) {
return o.id;
}))
but it returns only the id not whole object then i have to make more filter for get object
is there any direct method to find object?