Convert Celsius to Fahrenheit, help!

Convert Celsius to Fahrenheit, help!
0.0 0

#1

Tell us what’s happening:

Can anyone tell how to get past this and get all the tests passed at the same time?. The formula works but only checks off one. When I change the input , the check mark changes too.

Your code so far

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

// Change the inputs below to test your code
convertToF(celcius = 0);
convertToF(celcius = -30);
convertToF(celcius = -10);
convertToF(celcius = 0);
convertToF(celcius = 20);
convertToF(celcius = 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/65.0.3325.181 Safari/537.36 OPR/52.0.2871.64```.

**Link to the challenge:**
https://www.freecodecamp.org/challenges/convert-celsius-to-fahrenheit

#2

This is a bit of a guess.

I don’t think you need to include the test cases in your code window. The tester does that for you.
Try removing this part

convertToF(celcius = 0);
convertToF(celcius = -30);
convertToF(celcius = -10);
convertToF(celcius = 0);
convertToF(celcius = 20);
convertToF(celcius = 30);

I don’t know how the tester works but it may be balking at part where your wrote (sic) celcius= inside every parameter list. I would think that to be valid javascript but maybe the tester doesn’t like it.

Your formula obviously works and I got your code to run in codepen

Good luck


#3

You have a typo. Check your spelling very carefully.


#4

This was just crazy. Had to change the var above the line to the formula itself. And then change the line above and below to the input IE Celsius = “#”


#5

yeah I fixed the spelling but the issue was with where to put the equation. Had to change the variable in the var in the array to fahrenheit = celsius * 9/5 + 32;


#6

I think you might be confusing some of your terms. There is no array in this challenge.


#7

Yeah I am, sorry, point is I had to change the var to the equation in the lines we weren’t supposed to change then change the code where we could to the input of >celsius = “any of the input of degrees in celsius>”. I used celsius = 0 and Wallah!

Found the solution on YouTube by the way.