Convert Celsius to Fahrenheit var already defined

Convert Celsius to Fahrenheit var already defined
0

#1

Tell us what’s happening:

i keep getting the little caution triangle which states that var fahrenheit is already defined. whatt am i missing?

Your code so far

function convertToF(celsius) {
var fahrenheit;
  // Only change code below this line

var fahrenheit = (celsius * (9/5)) + 32;   
  
  // Only change code above this line
  return fahrenheit;
}

// Change the inputs below to test your code
convertToF(30);

Your browser information:

Your Browser User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.94 Safari/537.36.

Link to the challenge:


#2

Functions are defined when you declare them with the var keyword. You should only do this once per variable.


#3

Thank you ArielLeslie, much appreciated. all sorted now.