September 2019
Intermediate to advanced
432 pages
14h 38m
English
Templating is long overdue in JS as a core language feature. While it’s true that there have been many libraries and frameworks offering something similar, it’s nice that we can now do something without an external library.
Prior to template literals, JS developers have used single or double quotes to define strings. Inserting variables in strings as well as creating multiline strings have always been fairly ugly. This tension is outlined in chapter 6 as I introduce template literals as a better way to insert markup into our Web Components.
What does templating do for us in general? Consider the following string:
`Hi, my name is Ben Farrell and I live in Oakland, CA`
Read now
Unlock full access