Pages

map et destructuring !

const article = [
["title", 'Hello Template Literals'],
        ["teaser", 'String interpolation is awesome. Here are some features'],
        ["body", 'Lots and lots of sanitized HTML'],
        ["tags", ['es6', 'template-literals', 'es6-in-depth']]
]

let [title,teaser,body,tags] = article;
let html = `<article>
  <header>
    <h1>${title[1]}</h1>
  </header>
  <section>
    <div>${teaser[1]}</div>
    <div>${body[1]}</div>
  </section>
  <footer>
    <ul>
      ${tags[1].map(tag => `<li>${tag}</li>`).join('')}
    </ul>
  </footer>
</article>`

document.body.innerHTML= (`${html}`);