daily pastebin goal
26%
SHARE
TWEET

Untitled

a guest Apr 25th, 2018 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var test = [{"name": "a", "adress": "b"}, {"name": "b", "adress": "a"}];
  2.  
  3. test_sorted = test.sort(function (obj1, obj2) {
  4.     return obj1.adress < obj2.adress ? -1 : (obj1.adress > obj2.adress ? 1 : 0);
  5. });
  6.  
  7. console.log(test_sorted);
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top