1

I'm looking for a function that takes strings and values and assembles the template string as a normal untagged template literal would. Does this exist? What's the logic? What needs to go inside the tag function to make the test case be complete?

function tag(strings, ...values) {
  return ''
}

let example = soup

let one = tag`string text ${example} 1 string text line 2`
let two = `string text ${example} 1 string text line 2`

assert.equals(one, two)
ThomasReggi
  • 55,053
  • 85
  • 237
  • 424
  • I've asked a similar question before trying to get an answer for your question; In short, no there is not, but you can implement it yourself. http://stackoverflow.com/questions/38209627/how-to-call-native-es6-template-string-replacement-from-tag-function – Aaron_H Jan 09 '17 at 20:15

0 Answers0