Guest User

Untitled

a guest
Jan 19th, 2018
493
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