Workshop › Rhythm Lanes › Step 30 of 35
A chain of thresholds turns the accuracy into a letter: 95 or more is S, 85 an A, 70 a B, 50 a C, and below that a D.
```js
function grade() {
const a = accuracy()
return a >= 95 ? 'S' : a >= 85 ? 'A' : a >= 70 ? 'B' : a >= 50 ? 'C' : 'D'
}
```? : can be chained: the first true condition from the left wins. An accuracy of 90 fails >= 95 and passes
>= 85, so it is an A.Write grade above function update() { (under accuracy), with an empty line after it.
Skills: Functions