Question: a) In Atom, create a new program file named triangle.js in your p2 folder. b) Write a function named getTriangleType that accepts three numbers representing
a) In Atom, create a new program file named triangle.js in your p2 folder. b) Write a function named getTriangleType that accepts three numbers representing the sides of a triangle, and returns a string representing the triangle type, "equilateral", "isosceles", or "scalene". Use function expression syntax to define the function. An equilateral triangle has all three sides the same length. An isosceles triangle has at least two sides the same length. (It is sometimes specified as having exactly two sides the same length, but for the purposes of this exercise we'll say at least two). A scalene triangle has all sides of different lengths. Examples: > getTriangleType (2, 10, 12) > "scalene > getTriangleType ( 18, 18, 18) "equilateral
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
