Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Return a Sorted Array Without Changing the Original Array

function (arr) {
  return [].concat(arr).sort(function(a, b) {
    return a - b;
  });
}
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Return #Sorted #Array #Without #Changing #Original #Array
ADD COMMENT
Topic
Name
7+3 =