Change:
Feature Request: Add as valid method to clone/copy array and as an alternative to Link to challenge: I often use () to return an array copy, as this is what MDN recommends. When I was working on this challenge I could not get it to pass, even though my solution was returning the correct answer. The challenge ONLY accepts answers that use the format [].concat(arr). The wording in the challenge is clear, but experience from earlier challenges hava been lenient as long as you provide a valid solution. Other reasons: When googling for array copying the top result from MDN recommends slice.()MDN's Array page recommends using () for array copying opinion, is more readable than
You have to also view the test text as part of the instructions for the challenges. In this case, one of the the challenge test expects you to use the method. It even mentions the method in the Description section of the challenge. Always read the test text to make sure you understand what is being asked of you.
If anyone working on this issue? I would like to take care of this. In my opinion, has a point in that the test should allow .slice() if the effect is the same - we know that many times people can solve a problem in multiple ways, and that should be ok. Please let me know. I can either clarify the text so that the user knows to use concat, or I can modify both the description and the test so that .slice(0) is accepted ( I am inclining more towards the second option though).
I bring it up since alternative solutions has been accepted previously in the corriculum. As long as the final solution is correct. It was frustrating to have the tests fail even though the output was correct.
I normally would agree, but the description mentioned and the test case specifically tells you to use
Does it have to be specifically .concat() though? The test seems to be about learning mutation and which functions have side effects and how to work around that. We learn about both concat and slice earlier on, and it seems arbitrary to only accept concat. If the point of the challenge is to learn about concat that's fair. I'd recommend mentioning that .slice() is also an option, but ask to use .concat() still. If the point is avoiding mutation and being aware that certain methods like .sort() will have side effects on the original array. Then I don't understand why it's so strict.
and After thinking a bit more about your points, I agree this challenge could be updated to allow any valid method for copying the array (, , , ) and other possible ways not mentioned. While looking at the challenge tests, I also realized someone could still technically hard-code the final return value, so I created a PR to address your concerns and attempt to not allow hard coding of the final array returned.

Discussion:
## Description <section id='description'> <del> A side effect of the <code>sort</code> method is that it changes the order of the elements in the original array. In other words, it mutates the array in place. One way to avoid this is to first concatenate an empty array to the one being sorted (remember that <code>concat</code> returns a new array), then run the <code>sort</code> method. </del> <ins> A side effect of the <code>sort</code> method is that it changes the order of the elements in the original array. In other words, it mutates the array in place. One way to avoid this is to first concatenate an empty array to the one being sorted (remember that <code>slice</code> and <code>concat</code> return a new array), then run the <code>sort</code> method. </ins> </section> ## Instructions

```yml tests: - text: Your code should use the <code>sort</code> method. <del> testString: assert(code.match(/.sort/g), 'Your code should use the <code>sort</code> method.'); - text: Your code should use the <code>concat</code> method. testString: assert(code.match(/.concat/g), 'Your code should use the <code>concat</code> method.'); </del> <ins> testString: assert(nonMutatingSort.toString().match(/.sort/g)); </ins> - text: The <code>globalArray</code> variable should not change. <del> testString: assert(JSON.stringify(globalArray) === JSON.stringify([5, 6, 3, 2, 9]), 'The <code>globalArray</code> variable should not change.'); </del> <ins> testString: assert(JSON.stringify(globalArray) === JSON.stringify([5, 6, 3, 2, 9])); </ins> - text: <code>nonMutatingSort(globalArray)</code> should return <code>[2, 3, 5, 6, 9]</code>. <del> testString: assert(JSON.stringify(nonMutatingSort(globalArray)) === JSON.stringify([2, 3, 5, 6, 9]), '<code>nonMutatingSort(globalArray)</code> should return <code>[2, 3, 5, 6, 9]</code>.'); </del> <ins> testString: assert(JSON.stringify(nonMutatingSort(globalArray)) === JSON.stringify([2, 3, 5, 6, 9])); - text: <code>nonMutatingSort(globalArray)</code> should not be hard coded. testString: assert(!nonMutatingSort.toString().match(/[23569]/g)); </ins> ```