Coding task · JavaScript and TypeScript course · Module 2: Functions, Arrays and Objects
Dinosaur Description with Template Literals
A template literal starts and ends with a backtick, and you insert a variable with ${variableName}. You do not need the + operator.
Task
You have the data: const dinoName = 'Velociraptor', const dinoWeight = 15 and const dinoHeight = 1.8. Store a dinosaur description in a constant called description as a template literal: text in backticks (`) with all three variables inserted using ${...}, e.g. 'Velociraptor: 15 kg, 1.8 m'. Display description in the console.