Final string help


Entered the following code:

//Constant value of temp in Kelvin
const kelvin = 294;
//Convert kelvin to celcius
const celsius = kelvin - 273;
//Now change value of Fahrenheit to celsius
let fahrenheit = celsius * (9/5) + 32;
//print the value of F after calculation
//converts to an integer, no decimal point
fahrenheit = Math.floor(fahrenheit);
//Prints the temp in F as an integer
//print string inc. temp in F
console.log('The temp is ${fahrenheit} degrees fahrenheit.');

Following is printed:

The temp is ${fahrenheit} degrees fahrenheit.

Had expected an integer where ${fahrenheit} is, what am I missing?


to use es6 string interpolation with ${variable} like you did, the string needs to be enclosed in back-ticks, not apostrophes.


Ahhhhhh - ok, thanks!