javascript sort that don change 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;
})