SHARE
TWEET

Untitled

a guest Jan 19th, 2018 238 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function sorter(items, property){
  2.         return items.sort(function(a, b) {
  3.           var nameA = a[property] || ''
  4.           var nameB = b[property] || ''
  5.           if (nameA < nameB) {
  6.             return -1;
  7.           }
  8.           if (nameA > nameB) {
  9.             return 1;
  10.           }
  11.           return 0;
  12.         });
  13.     }
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
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top