r/ProgrammerTIL • u/ephemat234 • Oct 02 '23
Javascript TIL JavaScript provides string interpolation with string template literals
I started learning JavaScript in 2012 before this was full supported, never realized the backtick was used in JavaScript. It works great
const number = 2
const message = `The number is ${number}`
console.log(message); // => 'The number is 2'
10
Upvotes
View all comments
Show parent comment
3
u/[deleted] Oct 02 '23
Can decide if I like or hate that. Interesting to know, though, regardless.