← Back to challenges

Is It a Triangle?

JavaScriptHardmathconditionsvalidationgeometry

Instructions

Create a function that takes three numbers as arguments and returns true if it's a triangle and false if not.

Examples

isTriangle(2, 3, 4) ➞ true

isTriangle(3, 4, 5) ➞ true

isTriangle(4, 3, 8) ➞ false

Notes

  • a, b and, c are the side lengths of the triangles.
  • Test input will always be three positive numbers.
javascript
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: The 3 Programmers Problem