Created
September 4, 2013 20:08
-
-
Save mgechev/6442204 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var rooms = [ | |
| { | |
| "type": "Двустаен", | |
| "size": 100, | |
| "url": "http://www.homes.bg/ar130460", | |
| "phone": "0879354498", | |
| "location": "Ул./Бул. Тодор Александров", | |
| "price": 270 | |
| }, | |
| { | |
| "type": "Двустаен", | |
| "size": 61, | |
| "url": "http://www.homes.bg/ar233436", | |
| "phone": "0884717639", | |
| "location": "жк. Лозенец, София", | |
| "price": 230 | |
| }, | |
| { | |
| "type": "Тристаен", | |
| "size": 105, | |
| "url": "http://www.homes.bg/ar217733", | |
| "phone": "0897493026", | |
| "location": "жк. Лозенец, София", | |
| "price": 280 | |
| }, | |
| { | |
| "type": "Двустаен", | |
| "size": 64, | |
| "url": "http://www.homes.bg/ar239704", | |
| "phone": "0882785951", | |
| "location": "жк. Лозенец, София", | |
| "price": 280 | |
| }, | |
| { | |
| "type": "Двустаен", | |
| "size": 65, | |
| "url": "http://www.homes.bg/ar209954", | |
| "phone": "0893-618-553", | |
| "location": "Бул. Яворов", | |
| "price": 275 | |
| }, | |
| { | |
| "type": "Двустаен", | |
| "size": 75, | |
| "url": "http://www.homes.bg/ar228675", | |
| "phone": "0893-618-553", | |
| "location": "Бул. Св. Наум", | |
| "price": 280 | |
| }, | |
| { | |
| "type": "Ателие/таван", | |
| "size": 57, | |
| "url": "http://www.homes.bg/ar255538", | |
| "phone": "0897998813", | |
| "location": "Център", | |
| "price": 250 | |
| }, | |
| { | |
| "type": "Двустаен", | |
| "size": 64, | |
| "url": "http://www.homes.bg/ar248260", | |
| "phone": "0889746156", | |
| "location": "жк.Лозенец", | |
| "price": 265 | |
| } | |
| ]; | |
| function print(arr) { | |
| arr.forEach(function (r) { | |
| console.log(r.type, r.size, r.location, r.price, r.phone, r.url); | |
| }); | |
| } | |
| print(rooms.sort(function (a, b) { | |
| return a.price - b.price; | |
| })); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment