Code Challenge: Template Literals

Home   »   Code Challenge: Template Literals

Code Challenge: Template Literals
---------------------------------


A [Pen](https://codepen.io/onecraftychicka/pen/abJooGa) by [onecraftychicka](https://codepen.io/onecraftychicka) on [CodePen](https://codepen.io).

[License](https://codepen.io/onecraftychicka/pen/abJooGa/license).

Complete the challenge below by editing the code inside the JS section of this Codepen.

Use the developer console or the Codepen console (with the Console button provided by Codepen at the bottom left of your screen) to see console.log messages. Be aware that the Codepen console does not show all error messages, so if you're running into an error, try opening your browser's built-in developer console.

Challenge

  • Inside the JS section, rewrite the console.log line above using template literal syntax instead of string concatenation.
  • Tip: The backtick character is above the Tab key on most keyboards, on the same key as the tilde (~).

Additional Resources

const cardSuit = "Spades";
const cardValue = 5;
console.log(`You turn the card over. It is a ${cardValue} of ${cardSuit}!`); // edit this line to use template literal syntax.
body { 
  font-family: "Oxygen", sans-serif;
  margin: 1rem;
}

Leave a Reply

Your email address will not be published. Required fields are marked *