Advertisement
Spocoman

06. Smallest Two Numbers

Feb 6th, 2022
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function smallestTwoNumbers(arr) {
  2.  
  3.     console.log(arr.sort((a, b) => a - b).splice(0, 2).join(' '));
  4.  
  5. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement