是否可以将已赋值模板文字值的变量传递给函数,然后该函数使用函数调用它?
示例:
function strLiteralProcessor(str){
console.log(str);
return //what goes here? I want to call the tag function myTagFunc with str, but myTagFuncstr is obviously wrong.
};
var name = prompt("What's your name?");
strLiteralProcessor(`Hi, ${name}!`);
我会做myTagFunc(str)
之类的事情,还是我错过了什么?