Hi guys,
I am following the JavaScript 101 course with Szolt and I have a problem with the code of inputs and outputs when he uses the console.
His text is basically about adding constant values and he adds a crypto ticker and a number to buy. After he does this, he runs the console by trying to display the message: You have just bought 1.15 BTC. I checked his code ten times to see if my identical code has mistakes but it seemingly does not have any mistakes and is identical to his. However, in his version the message displays as intended while my result is: You have just bought ${amount}${ticker} . Can someone explain to me what I am doing wrong? Please find my code below:
const ticker = prompt ('Enter your crypto ticker: ');
const amount = +prompt ('Enter the amount you bought: ');
console.log('You have just bought ${amount}${ticker}');
So, if I add the ticker BTC and 1.15 I should get the message " You have just bought 1.15 BTC". Instead I get "You have just bought $(amount)$(ticker)
Not sure if this matters but I am using Brave as browser and MAC as operating system.
Thank you for the help.