DekGenius.com
Home
(current)
Dictionary
BOOKS
LYRICS
CHORD
SCRIPT & CODE EXAMPLE
Karaoke language
Search
Go
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
COMMENT
Name
7+3 =
Submit