Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.31 KB | None | 0 0
  1. function myFunc() {
  2. return Array.prototype.slice.call(arguments);
  3. // args is now a real Array, so can use the sort() method from Array
  4. }
  5. console.log(myFunc('USA', 'UK', 'India'));
  6. console.log(myFunc('USA', 'UK', 'India').sort());
  7.  
  8. // Will output =>
  9. // [ 'USA', 'UK', 'India' ]
  10. // [ 'India', 'UK', 'USA' ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement