I think they just meant that you shouldn't mutate the original array/object directly. Best practice would be to return a new array with the correctly arranged elements within it.
Would be a minor code change, and would be more widely accepted since you should never mutate original data in a black box style function call.
Your move function doesnt return anything.
Which means its mutating the array directly or your code doesnt work.
Either way you will need to fix it.
It works perfectly with tests
github.com/jalal246/move-position/...
I think they just meant that you shouldn't mutate the original array/object directly. Best practice would be to return a new array with the correctly arranged elements within it.
Would be a minor code change, and would be more widely accepted since you should never mutate original data in a black box style function call.
It's optional just pass
{isMutate: false}
and it won't mutate: github.com/jalal246/move-position#....It depends. 1-The scale of your data 2-Data mutation frequency 3-Data reference type.