I have json object of which I would like to get the min price. Below is the response.
[
{
"room": {
"price": 217,
"available": true
}
},
{
"room": {
"price": 302,
"available": true,
}
},
{
"room": {
"price": 427,
"available": true,
}
}
]
I have tried a solution from Stackoverflow but it won't work in case.
var arr = Object.keys( response ).map(function ( key ) { return response[key]; });
var min = Math.min.apply( null, arr );
Please help