← Back to challenges

A Long Long Time

JavaScriptHardnumbersdatesmathconditions

Instructions

Create a function that takes three values:

  • h hours
  • m minutes
  • s seconds

Return the value that's the longest duration.

Examples

longestTime(1, 59, 3598) ➞ 1

longestTime(2, 300, 15000) ➞ 300

longestTime(15, 955, 59400) ➞ 59400

Notes

No two durations will be the same.

javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Purge and Organize