I can’t get passed the test. Could you kindly help me figure out the problem?

Tell us what’s happening:
Describe your issue in detail here.

  **Your code so far**

const globalArray = [5, 6, 3, 2, 9];

function nonMutatingSort(arr) {
// Only change code below this line

return[].concat(arr).sort(function(a , b){
a - b;
});

// Only change code above this line
}

nonMutatingSort(globalArray);
  **Your browser information:**

User Agent is: Mozilla/5.0 (iPhone; CPU iPhone OS 15_4_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/15.4 Mobile/15E148 Safari/604.1

Challenge: Return a Sorted Array Without Changing the Original Array

Link to the challenge:

Hi @Mikael3211 !

You’re close.

Right now your sort function is not returning anything.

Once you fix that then it will pass

1 Like

@jwilkins.oboe thank you :blush:

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.