0

Hello I am doing this function calculating the hypotenuse. here the code I created so far. I have to use the Math.sqrt() method which is a part of the requirement. Once the code is running nothing occurs. Thanks for your help guys!

 function getHeight() {
 var n = 5;
 return = n;
 }
 function getWidth() {
 var n = 12;
 return n;
 }
 function getHypotenuse(height,width) {
 var hypotenuse = Math.sqrt(height*height + width*width);
 return hypotenuse;
 }
 function displayHypotenuse() {
 alert("the hypotenuse is: " + getHypotenuse(getHeight(),getWidth()));
 }
 function init() {
 displayHypotenuse();
 }
 window.onload = init;
Max59430
  • 13
  • 1
  • 2
  • Check for errors in your browser's console. They'll be there, if you look for them. – Alnitak Jul 21 '15 at 11:55
  • 1
    this question should be closed because the most trivial of debugging efforts would have shown the syntax error in `return = n` – Alnitak Jul 21 '15 at 11:56

1 Answers1

3

Instead of

function getHeight() {
 var n = 5;
 return = n;
 }

use

function getHeight() {
 var n = 5;
 return n;
 }

The issue is with return = n

jrath
  • 980
  • 4
  • 14