Introduction to JavaScript Exercise 9 Functions and methods IV


#1

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;
console.log(celsius);
return fahrenheit;

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


#2

Hi, I’m not yet on function, but as I see you have typo here

do you meen

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

#3

theremore, it should return celsius not fahrenheit


#4

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

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


#5

yes that what we should do for converting Fahrenheit to Celsius


#6

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