[node.js] backtick(`) *template string

Hyo Kyun Lee·2021년 7월 26일
0

node.js

목록 보기
13/34

backtick을 통한 template string 구현

문자열내 변수화한 문자 및 상수를 사용하기 위해선 백틱을 사용한다.

이때 변수화한 문자 및 상수를 template stirng이라 한다.

"use strict";

const details = "nate.com";

let str = "google.com";
//template string을 사용하기위해선 백틱을 사용한다!
str = str + `added with ${details}`;

console.log(str);

0개의 댓글