sort without changing original array code example
Example: sort array without changing original array
let sorted = [].concat(arr).sort(function(a, b) {
return a - b;
})
let sorted = [].concat(arr).sort(function(a, b) {
return a - b;
})