Yes, you are correct. Just be careful some of those single quotes in the code you posted are actually backticks(`) so, the code will not run. Here it is without those items fixed.
function greeting(name) {
alert("Hello " + name);
}
function processUserInput(callback) {
var name = prompt("Please enter your name.");
callback(name);
}
processUserInput(greeting);
If they are backticks, then also the code should run I suppose, because it will be the template literal.
I just searched for ‘callback functions mdn’, it gave me the following page.
Yes indeed. If they are both backticks it will work. However, unless you are doing string interpolation or creating tagged templates, I would recommend sticking with plain strings.