sort without changing 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;
})