Hacker News new | ask | show | jobs
by oregondan 3506 days ago
It is a bit of an anachronism, yeah. Soon, though, we'll have template literals [1], and this example will just be out of date.

[1] https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...

1 comments

<template> elements are also implemented everywhere but IE: http://caniuse.com/#feat=template

The advantage of <template> over strings in JS is that the browser can parse the <template> as HTML in parallel with parsing your JS. Less JS to parse means faster cold loads.