bobo_bobkata

Untitled

Oct 8th, 2019
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. function sort(array, typeOfSort) {
  2. if (typeOfSort === 'asc') {
  3. return array.sort((e, e1) => {
  4. return e - e1;
  5. });
  6. } else {
  7. return array.sort((e, e1) => {
  8. return e1 - e;
  9. });
  10. }
  11.  
  12. }
Add Comment
Please, Sign In to add comment