freeCodeCamp: "Reference error: Fahrenheit not defined" shows up before starting challenge
Challenge Convert Celsius to Fahrenheit has an issue.
User Agent is: Mozilla/5.0 (X11; CrOS x86_64 7978.74.0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.103 Safari/537.36.
Please describe how to reproduce this issue, and include links to screenshots if possible.
My code:
function convertToF(celsius) {
// Only change code below this line
var a=32;
var b=9/5;
var c=30;
var d= a + b * c;
// Only change code above this line
return fahrenheit;
}
// Change the inputs below to test your code
convertToF(30);
About this issue
- Original URL
- State: closed
- Created 8 years ago
- Comments: 15 (8 by maintainers)
@nellee24 Please do not post your solution on here. You could help people at FreeCodeCamp Chat Room or Forum. GitHub Issues are for reporting bugs on the website only.
Happy Coding!
I believe the code is incomplete: function convertToF(celsius) { var fahrenheit;
NB: var fahrenheit isn’t assigned to the parameter “celsius” of the above function, and as the instruction below states the the student shouldn’t edit it thus the function won’t work
// Only change code below this line
// Only change code above this line return fahrenheit; }
<hr>This is my example:
function convertToF(celsius) { var fahrenheit = celsius; // Only change code below this line fahrenheit *=1.8; fahrenheit +=32; // Only change code above this line return fahrenheit; }
// Change the inputs below to test your code convertToF(30);
I’ll start working on it after work or first thing tomorrow morning! I actually remember this from when I was going through this section.
@erictleung agreed. looks like this is an oversight no one saw earlier. But they have been introduced to variables at least, nevertheless, I guess we should be defining it.