JS에선 백틱이 python의 f-string과 ''' '''
의 기능을 동시에 수행한다.
모든 string 을 백틱으로 작성하는 사람도 있다고 하고, 그게 편할 수 있다고 한다.
매우 공감한다.
const firstName = 'John';
const thisYear = new Date().getFullYear();
const birthYear = thisYear - 26;
const job = 'Web Developer';
console.log(`I'm ${firstName}, a ${thisYear - birthYear} years old ${job}!`);
// I'm John, a 26 years old Web Developer!
console.log(`String
multiple
lines`);
// String
// multiple
// lines