[Javasciprt] (ES6) Template Literals ํ™œ์šฉ ๋ฐฉ๋ฒ•

ํ…œํ”Œ๋ฆฟ ๋ฆฌํ„ฐ๋Ÿด (Template Literals)

` ํ‚ค๋ณด๋“œ์˜ Tabํ‚ค ์œ„์— ์žˆ๋Š” ๋ฌธ์ž

var a = 100;
var b = 200;

// ๊ธฐ์กด
var str = '๊ฐ’ = ' + (a + b);

console.log(str); // ๊ฐ’ = 300

// ES6
var str = `๊ฐ’ = ${a + b}`;

console.log(str); // ๊ฐ’ = 300

์ข€ ๋” ๊ฐ„ํŽธํ•˜๊ฒŒ ๋ฌธ์ž์—ด์„ ํ‘œํ˜„ ํ•  ์ˆ˜ ์žˆ๋‹ค.

๋‹ค๋ฅธ ๊ธ€ ์ฝ์–ด๋ณด๊ธฐ โฌ‡๏ธ