Final string help


#1

Hi,
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
console.log(fahrenheit);
//converts to an integer, no decimal point
fahrenheit = Math.floor(fahrenheit);
//Prints the temp in F as an integer
console.log(fahrenheit);
//print string inc. temp in F
console.log('The temp is ${fahrenheit} degrees fahrenheit.');

Following is printed:

69.80000000000001
69
The temp is ${fahrenheit} degrees fahrenheit.

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


#2

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


#3

Ahhhhhh - ok, thanks!