Guest User

Untitled

a guest
Jun 25th, 2018
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.60 KB | None | 0 0
  1. if (payload.search) {
  2. let index = members.length;
  3. while (index--) {
  4. const mem = members[index];
  5. if (!mem.name.includes(payload.search)) {
  6. members.splice(members.findIndex(item => item.name === mem.name), 1);
  7. }
  8. }
  9. }
  10.  
  11.  
  12.  
  13.  
  14.  
  15. if (payload.search) {
  16. let index = members.length - 1;
  17. while (index >= 0) {
  18. const mem = members[index];
  19. if (!mem.name.includes(payload.search)) {
  20. members.splice(members.findIndex(item => item.name === mem.name), 1);
  21. }
  22. index -= 1;
  23. }
  24. }
Add Comment
Please, Sign In to add comment