JavaScript JavaScript Basics Working with Strings Combine Strings and Template Literals Review

Joseph Harlow
Joseph Harlow
Front End Web Development Techdegree Student 8,243 Points

Complete the code below to create a template literal: const headline = '<h1>A Literal Headline</h1>';

Please help. Can't seem to get this one.

Tim Oltman
Tim Oltman
7,714 Points

Template literals are created only with the "tick" or "prime" character that is located to the left of the number 1 on your keyboard (above tab). This is different than the single quote character you are using in your question above.

1 Answer

Steven Parker
Steven Parker
207,973 Points

As Tim observed, template literals are enclosed in accents ("backticks") instead of apostrophes:

` :point_left: these, not these :point_right: '

But it might be worth pointing out that a template literal is not needed in this example, as no tag, interpolation tokens or newlines exist here. A plain string would do just as well here in practical code (and would be more "best practice").