Tell us what’s happening:
not sure whats wrong please help.
SyntaxError: unknown: Identifier ‘fahrenheit’ has already been declared (3:6)
1 | function convertToF(celsius) {
2 | var fahrenheit = celsius * (9 / 5) + 32;
3 | let fahrenheit;
| ^
4 | return fahrenheit;
5 | }
6 |
Your code so far
function convertToF(celsius) {
var fahrenheit = celsius * (9 / 5) + 32;
let fahrenheit;
return fahrenheit;
}
convertToF(30);
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/80.0.3987.116 Safari/537.36
.
Challenge: Convert Celsius to Fahrenheit
Link to the challenge:
https://www.freecodecamp.org/learn/javascript-algorithms-and-data-structures/basic-algorithm-scripting/convert-celsius-to-fahrenheit