I saw that tags can be used like this, and you may need it for "security" reasons, anyway, here is the example I got :
let person = 'Mike';
let age = 28;
function myTag(strings, personExp, ageExp) {
let str0 = strings[0]; // "that "
let str1 = strings[1]; // " is a "
let ageStr;
if (ageExp > 99) {
ageStr = 'centenarian';
} else {
ageStr = 'youngster';
}
return str0 + personExp + str1 + ageStr;
}
let output = myTag `that ${ person } is a ${ age }`;
console.log(output); // that Mike is a youngster
But what is the point of "tagging" some strings, you do not even need that to get the result of this example, a simple function can do the job, could you give me an other example and some explanation with it ?