As the Unexpected token ... syntax error says, not a tag is a problem, but using the rest statement. Try the following:
var a = 5, b = 10; function tag(strings) { var pp=""; pp+=strings[0]; // "Hello " pp+=strings[1]; // " world " pp+=arguments[1]; // 15 pp+=arguments[2]; // 50 return pp+"Bazinga!"; } console.log(tag`Hello ${ a + b } world ${ a * b}`);
According to the ES6 compatibility table , you need to enable the rest syntax using the harmony flag in current Chrome.
Bergi source share