Hi,
I’m at the stage in variables where they teach about backticks. This is really baffling me. ` <---- That is a backtick, right? My code was as follows.
console.log(‘My name is ${myName}. My favourite city is ${myCity}’)
That just printed ${myName} in the console instead of the variable assigned to it (I just haven’t shown the variable). When I check the solution, it looks absolutely identical to what I’ve written but ${myName} isn’t regarded as a string. What can I do?
Thanks
Are you using a standard US layout keyboard? As far as I know macs use the same layout as any other keyboard, with the backtick being right above the TAB key.
Based on your code:
console.log(‘My name is {myName}. My favourite city is {myCity}’)
It looks like you are not using a backtick
No I’m using a mac UK layout keyboard. ± and § are above my tab.I looked up how to get a backtick on mac. It said to do alt + \ but that just got me « and it doesn’t work in my code. (Also, I realise I forgot $ before {myName} in my post but it’s in my code)
Got it. Thanks. I had tried using that key before but hadn’t realised that it replaced quotation marks. I thought it simply was like ${myName}
. Thanks for the help!
Happy that we could figure it out! While searching on google, I found that “back tick” might be the American name for a “backquote”. Searching for how to type a backquote on a UK layout keyboard is how I found the solution
If somebody still did not find the answer switch your keyboard to Britsh - PC, under English. There you will be able to use ` left from the number one key.
Hi,
Just to add that if you have the Mac Latin Keyboard (with the ñ) to get this backtick
you need to press: option + ]
Note its not a J it’s the key that has the “] }” on it.
Greetings!
This worked for me! Thanks!