I am a starter javascript hobbyist and I am confused about connecting strings.
I tried
const html = `<p>Hello World!</p>`;
console.log( "response.end(`" + html + "`);");
and expected response.end(`<p>Hello World!</p>`)
but received response.end(`<p>Hello World!</p>`;}
.
I am really confused. I thought this might be to do with escaping characters.
Edit:
Full code
var staffcontent = fs.readFileSync(path.join(__dirname, "/assets/staff.html"), 'utf8'); console.log("response.end(`" + staffcontent + "`);"); eval("response.end(`" + staffcontent + "`);");