Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

convert arguments to array javascript

// Use a simple spread operator with the arguments

function ArrangeInOrder(...args) {
  args.sort();
  return args;
}

ArrangeInOrder(1,4,3,9,5,3,6,2,8,7,5,9,3,7);
// << [1, 2, 3, 3, 3, 4, 5, 5, 6, 7, 7, 8, 9, 9]
 
PREVIOUS NEXT
Tagged: #convert #arguments #array #javascript
ADD COMMENT
Topic
Name
7+6 =