Introduction to JavaScript Exercise 9 Functions and methods IV

The exercise asks us to write a function to convert Fahrenheit to Celsius. I have written the correct function for converting F to C:

function getCelsius(fahrenheit) {
var celsius(fahrenheit - 32)1/8;
return fahrenheit;

Why, when I run it, does the code change to(fahrenheit - 32) * 5/9; ?

Hi, Iā€™m not yet on function, but as I see you have typo here

do you meen

var celsius = (fahrenheit - 32)*1/8;

theremore, it should return celsius not fahrenheit

Yes, I do, but because I got stuck the first time, does the code appear as:

var celsius = (fahrenheit - 32)*5/9; ?

1 Like

yes that what we should do for converting Fahrenheit to Celsius

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.