Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function usernames (inputs) {
- let unique = inputs.sort().sort((a,b)=> (a.length - b.length)).filter((v, i, a) => a.indexOf(v) === i);
- console.log (unique.join('\n'));
- }
- usernames(
- [
- "Ashton",
- "Kutcher",
- "Kutcher",
- "Ariel",
- "Lilly",
- "Keyden",
- "Aizen",
- "Billy",
- "Braston"
- ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement