For example if I have a variable:
const template = `line 1
line 2
line 3`;
I want console.log(template) to print:
line 1\nline 2\nline 3
Just stringify it
const template = `line 1
line 2
line 3`;
console.log(JSON.stringify(template))
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With