# Template Literals

[Template Literals](https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Template_literals)는 다른 언어에도 존재하여 익숙할 문자열 포맷팅 문법이다. 예를 들면, `printf("%s")` 나  `print("{} and {}")` 과 같다.

그 사용 방법은 아래와 같다.

```javascript
let datatime = (new Date()).toDateString();
console.log(`<div class="date">${datetime}</div>`);
```

문제는 마음껏 사용할 수 없는 문법이라는 점이다.

[ES6 호환성 표](https://kangax.github.io/compat-table/es6/)를 보면 Internet Explorer 11 버전에서조차 이것을 지원하지 않는다.&#x20;

babel 트랜스컴파일러에서는 이것을 변환하는 플러그인 [@babel/plugin-transform-template-literals](https://babeljs.io/docs/en/babel-plugin-transform-template-literals)을 지원한다.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://devlog.joonas.io/javascript/template-literals.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
