---
id: 5d7925399afb905c34730a75
title: Part 129
challengeType: 0
isBeta: true
---
## Description
But our function takes an array of numbers, not strings. Luckily, you can pass a function `fn` as argument to sort:
```js
[2, 9, 10, 15].sort((a, b) => b - a); // [10, 9, 5, 2]
```
If `b - a` is less than 0, then `a` will be placed before `b`. As a result, this sorts the array in descending order.
Use `sort` to sort `nums` in ascending order.
## Instructions
## Tests
```yml
tests:
- text: See description above for instructions.
testString: assert(/constmedian=nums=>\{constsorted=nums\.sort\(\((.+),(.+)\)=>\1-\2\)/.test(code.replace(/\s/g, "")));
```
## Challenge Seed
```html
```
### Before Test
### After Test
```html
```
## Solution