I have the following json object:
var json = {
"acao": "listaHoteis",
"hoteisPesquisa": [
{
"home_id": "1",
"nome": "Itamarati"
"preco": "925"
}, {
"home_id": "2",
"nome": "copacabana"
"preco": "102.1"
}, {
"home_id": "3",
"nome": "Itamarati"
"preco": "215"
},{
"home_id": "4",
"nome": "Litoral Htel"
"preco": "1001"
}
]
};
How do I filter this object so that I can only show hotels where the price is higher than 100 and less than 900?
var json = {
"acao": "listaHoteis",
"hoteisPesquisa": [
{
"home_id": "2",
"nome": "copacabana"
"preco": "102.1"
}, {
"home_id": "3",
"nome": "Itamarati"
"preco": "215"
}
]
};
Is there any way I can filter the object and keep all properties? Thanks!