Skip to content

Instantly share code, notes, and snippets.

@isabolic
Last active January 2, 2018 13:56
Show Gist options
  • Select an option

  • Save isabolic/efc5a1c1fa581967761f72966774d41f to your computer and use it in GitHub Desktop.

Select an option

Save isabolic/efc5a1c1fa581967761f72966774d41f to your computer and use it in GitHub Desktop.
isTriangle
// Heron's Formula
function isTriangle(a,b,c)
{
return (a < (b + c)) && ((a + b) > c) && ((a+c) > b);
}
isTriangle(1,2,2) // => true
isTriangle(7,2,2) // => false
isTriangle(1,2,5) // => false
isTriangle(4,2,3) // => true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment