2 ms·
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.o
by oregondan 10y 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/Reference/Template_literals https://developer.mozilla.org/en-US/docs/Web/JavaScript/Refe...
- rictic 10y ago<template> elements are also implemented everywhere but IE: http://caniuse.com/#feat=template 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.