--- id: 5d792539728d1aa7788e2c9b title: Part 130 challengeType: 0 isBeta: true --- ## Description
Unfortunately, `sort` not only returns a new array, but also modifies the existing one. So our function also modifies the array passed to it - it is impure. You can fix this by adding `.slice()` between `nums` and `sort` - this creates a new array, that is equivalent to `nums`, but is immediately discarded, so it doesn't matter if it changes.
## Instructions
## Tests
```yml tests: - text: See description above for instructions. testString: assert(/constmedian=nums=>\{constsorted=nums\.slice\(\)\.sort\(\((.+),(.+)\)=>\1-\2\)/.test(code.replace(/\s/g, ""))); ```
## Challenge Seed
```html ```
### Before Test
```html Spreadsheet
```
### After Test
```html ```
## Solution
```html ```