Advertisement
kstoyanov

06. Sort Array

Sep 18th, 2020
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function solve(args) {
  2.   const twoCrtSort = (cur, next) => cur.length - next.length || cur.localeCompare(next);
  3.   args.sort(twoCrtSort);
  4.   console.log(args.join('\n'));
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement