Im learning javascript using webtools of essential webbrowsers (toolset with F12). here is a show up example
function sayHello(n){
document.writeln($`Hello {n}`);
}
sayHello("Andy Anderson");
//undefined appears as a result.
I expected result as "Hello Andy Anderson" but I got an undefined
The dollar sign comes before the opening curly brace:
document.writeln(`Hello ${n}`);
function sayHello(n){
document.writeln(`Hello ${n}`);
}
sayHello("Andy Anderson");