SHARE
TWEET

Untitled

a guest Jul 22nd, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. const boarders = [];
  2. const usernames = [];
  3.  
  4. for (let i in reach.var.d.c) {
  5.     const boarder = reach.var.d.c[i];
  6.    
  7.     if (security.specificContactCan(boarder, "BE_BOARDER")) {
  8.         boarders.push(boarder);
  9.     }
  10. }
  11.  
  12. for (let i = 0; i < boarders.length; i++) {
  13.     const boarder = boarders[i];
  14.    
  15.     usernames.push(boarder.un);
  16. }
  17.  
  18. usernames.sort(function(a, b) {
  19.     const aUsername = a.toLowerCase();
  20.     const bUsername = b.toLowerCase();
  21.    
  22.     if (aUsername < bUsername) {
  23.         return -1;
  24.     } else if (aUsername == bUsername) {
  25.         return 0;
  26.     } else {
  27.         return 1;
  28.     }
  29. }).reverse();
  30.  
  31. console.log(usernames);
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