0
HELP! Simple function(JavaScript), canât output variables.
Function message(){ Let name = prompt(âEnter your name.â); Let vacation = prompt(âwhat is your favorite vacation spot?â); document.write(â ${name}, you love to travel to ${vacation}â); } Message(); //=======BROWSER======== ${name}, you love to travel to ${vacation} // itâs not outputting my variables. What am I doing wrong?
2 RĂ©ponses
+ 3
you are using single quotes where template string must be enclosed by backticks (`):
document.write(`${name}, you love to travel to ${vacation}`);
0
visph thank you so much for that. that clearied it up for me!!!