Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var test = [{"name": "a", "adress": "b"}, {"name": "b", "adress": "a"}];
- test_sorted = test.sort(function (obj1, obj2) {
- return obj1.adress < obj2.adress ? -1 : (obj1.adress > obj2.adress ? 1 : 0);
- });
- console.log(test_sorted);
Add Comment
Please, Sign In to add comment