When using the single Template literal, why use the sign? What is the difference between coding console.log( 'Hello my name is' {myName}) and console.log(‘Hello my name is’ {myName})
It doesnt show the dollar sign in front of the first one for some reason??
I am unable to connect to Codecademy when I get to this page - String Interpolation 8/10
I have already commented on another thread about this issue. Codecademy works fine everywhere else I have gone it seems but when I try to continue my course in JavaScript it is unable to connect at this page. Please fix as I cannot progress any further with this issue. Thank you.
To use a backtick in a template literal(which is surrounded by backticks) you could use \`
If you are trying to use a backtick in a string surrounded by single or double quotes, you would enter the backtick without the need for the backslash.
Scoping variables is good practice, especially if we are conscious of why and where we are scoping them to. Written as they are in your example is okay for working in global scope only, but once we get into a function then we can run into problems. All non-scoped variables at any level of function nesting will automatically become properties of the window object and be exposed to the whole program. This can have disastrous effects.