Is it possible for a variable that has been assigned the value of a template literal to be passed to a function, and then that function calls it with a function?
Example:
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}!`);
Do I do something like myTagFunc(str)
or am I missing something?
No comments:
Post a Comment