Template Literals
Template literals are strings written with backticks instead of quotes. They
let you drop values straight into the text, which is cleaner than joining strings
with +.
const name = "Boots";
`Hi ${name}!`; // "Hi Boots!"
Inside the backticks, ${...} is a window where any value can show through.
Your task
Write greet(name, level) that returns exactly this string:
Hello {name}, you are level {level}!
For example, greet("Boots", 7) returns Hello Boots, you are level 7!.
β‘ 25 XP
π§± Code blocks
Drag a block into the editor, or tap it to drop it in where your cursor is. Add them in order to build your answer.
solution.jsRuns in your browser
Loading editorβ¦
Tests2 to pass
greet formats correctly
works with other values
Run your code to check these.