KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a JavaScript array of houses like so, { "homes" : [{ "home_id" : "1", "address" : "321 Main St", "city" : "Dallas", "state" : "TX", "zip" : "75201", "price" : "925", "sqft" : "1100", "year_built" : "2008", "account_type_id" : "2", "num_of_beds" : "2", "num_of_baths" : "2.0", "geolat" : "32.779625", "geolng" : "-96.786064", "photo_id" : "14", "photo_url_dir" : "\/home_photos\/thumbnail\/2009\/06\/10\/" }], .......... } I want to provide 3 different search methods. How can I return a subset of this homes area array that has: The price between X and Y The bathrooms >= Z The # of bedrooms == A or == B or == C For example, how would I create the psuedo code like: homes.filter {price >= 150000, price <= 400000, bathrooms >= 2.5, bedrooms == 1 | bedrooms == 3}
Tags (comma-separated)
Save Edits
Cancel