Solved various puzzles with JavaScript'a . And I stumbled on this: The goal is to remove the minimum value from the array, despite the fact that the location of the elements should not change, I sort of coped with the task, but the site does not skip, one test fails. Writes that it is necessary to check for a mutated array.
function removeSmallest(numbers) { var min, minindex; min = numbers[0]; minindex = 0; for(var i = 0; i < numbers.length; i++) { if(min > numbers[i]) { min = numbers[i]; minindex = i; } } numbers.splice(minindex, 1) return numbers; } What am I doing wrong and what kind of check should I do? Problem with codewars

numbers. What to do - do not change thenumbers- andreymal