Learn javascript - Objects 8 - The this keyword 10/15



I’ve got an idea for a hint. How about telling us to use backticks instead of the single quotes that have been used in everything up to this point. I had everything right except for the backticks & I was staring at my screen for almost 45 minutes.
Single quote: '
Backtick: `
After some rumaging online, this looks like the only place that that’s required, in template literals.

10 The this Keyword 1 - please explain backticks

If the environment supports template literals then go ahead and use backticks to denote all strings, and only resort to quotes when the situation dictates. Backticks are fully supported if template literals are.

const vis = [`red`,`orange`,`yellow`,`green`,`blue`,`indigo`,`violet`]

Bottom line, literally, backticks all the way. It will reduce escapements by many fold, not to mention elliminate the drudgery of string formulation in general.

As for the hint being less than substantial, prompting this topic, we cannot speak for CC from this side. We only support each other, and move along.


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