${} Format note displaying value


Doing the Javascript Intro exercise to convert temp (Kelvin) and the value does not display - The temp is ${fahrenheit} degrees Fahrenheit. No idea what I am doing wrong here - here is my code:

//kelvin will be used to convert to Celcius
const kelvin = 294;
//celsius is 273 minue kelvin
const celsius = kelvin - 273;
//fahrenheit is the below
let fahrenheit = celsius * (9 / 5) + 32;
fahrenheit = Math.floor(fahrenheit);
console.log(‘The temp is ${fahrenheit} degrees Fahrenheit.’);


Please use the editors’ button for formatting code so that it remains intact (otherwise people cannot accurately copy it and thus would be looking at other code)


How do I select the Editors button when in the console for CodeAcademy?


The problem here is that if I copy code from your post and run it, this is the result:

When asking about a piece of code you need to make sure that others receive an exact copy so that when they run it, the same thing as what you are asking about happens for them. (Otherwise the point of posting the code is missed, because the code you ask about isn’t there)



A good start would be to read up on the thing you’re trying to use (template literals)

A good approach to solving your trouble here is to copy an example from that webpage, run it and verify that it does what you mean to do, and then adapt your own code to match.
(And finally take note of what needed to be different, this is likely the most important part)


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