← Back to challenges

Highest Digit

JavaScriptHardnumberslanguage_fundamentals

Instructions

Create a function that takes a number as an argument and returns the highest digit in that number.

Examples

highestDigit(379) ➞ 9

highestDigit(2) ➞ 2

highestDigit(377401) ➞ 7
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Even All the Way