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.

  1. Use Math.max() to determine the highest value among the three.
  2. Return that maximum value.

01EXAMPLE 1

Inputn1 = 5, n2 = 10, n3 = 8
Output10

Constraints

  • Use Math.max().
FundamentalsMath
JavaScript
Loading...
3 Hidden

Input Arguments

n15
n210
n38

Expected Output

10

Click RUN to test your solution