The Peak Seeker
Easy+15 XP
Mission Briefing
Three towering mountains stand before the adventurers. They must scale the absolute highest peak. You need to write an algorithm to find the tallest mountain instantly.
The Concept: Maximum Value
Instead of writing complex if/else statements to compare numbers, JavaScript provides Math.max(...numbers), which instantly returns the largest number from the ones provided.
The Objective
Your function receives three numbers: n1, n2, and n3.
- Use
Math.max()to determine the highest value among the three. - Return that maximum value.
01EXAMPLE 1
Input
n1 = 5, n2 = 10, n3 = 8Output
10Constraints
- Use Math.max().
FundamentalsMath
JavaScriptSystem handles I/O — write your function only
Loading...
3 Hidden
Input Arguments
n15
n210
n38
Expected Output
10
Click RUN to test your solution