sort array without changing original array

Solutions on MaxInterview for sort array without changing original array by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
showing results for - "sort array without changing original array"
Max
17 Sep 2018
1let sorted  = [].concat(arr).sort(function(a, b) {
2    return a - b;
3  })
4
Adrienne
28 Apr 2019
14 54 67 21 6