Weather App - Celsius/Fahrenheit Toggle Button Not Working

Hi everyone,

I’m at the last User Story requirement for the Weather App. I can’t seem to get my C/F degrees toggle button to work. Can anyone please review my code, and if you can assist me in a better solution I would be super grateful. Thank you!

Here is the link to it…


You are initializing your toggle like const toggle = false;. Where do you change its value in here? :

           if(toggle == true){
                $("localTemp").html(tempF + "°F");
            } else {
                $("localTemp").html(tempC + "°C");

so if toggle is false all the time you will have executed only the else part all the time.

Another thing. If you define a boolean variable like var myvar = true; then you can only use if(myvar){do something} else {do something else}