Повторяющиеся шаблоны

1
2
3
4
5
6
7
8
9
10
11
12
13
const student = {
name: "Ryan Christiani",
blogUrl: "http://ryanchristiani.com"
}
const studentTemplate = templater`<article>
<h3>${'name'} is a student at HackerYou</h3>
<p>You can find their work at ${'blogUrl'}.</p>
</article>`;
const myTemplate = studentTemplate(student);
console.log(myTemplate);

Ввод будет таким

1
2
3
4
5
Output will look like this!
<article>
<h3>Ryan Christiani is a student at HackerYou</h3>
<p>You can find their work at http://ryanchristiani.com.</p>
</article>