---
id: 5d792539b2e0bd8f9e8213e4
title: Part 133
challengeType: 0
isHidden: true
---
## Description
Use the ternary operator to return `average([sorted[middle], sorted[middle + 1]])` if `length` is even, and `sorted[middle + 0.5]` otherwise.
Note that the `middle` variable is close to the middle but is not actually the middle.
## Instructions
## Tests
```yml
tests:
- text: See description above for instructions.
testString: assert(median([1, 20, 3]) === 3 && median([27, 7, 20, 10]) === 15);
```
## Challenge Seed
```html
```
### Before Test
### After Test
```html
```
## Solution