Creating Template Functions With Javascript | Task

Ole Ersoy
Jun - 14  -  1 min

Scenario

We have a template string:

`The character is ${C}`

And we need to pass C to it such that we can create string like:

The character is Q

Approach

export function characterTemplate(C:string) {
  return `The character is ${C}`
}

Demo