Loading topic
...args) and that you know basic template literals: backticks, ${} substitutions, and multiline strings. We will look at what JavaScript does when an expression sits directly in front of a template literal, in what ord5 min readstrings array and a list of values (covered in the previous chapters). You should also be comfortable with escape sequences such as \n, \t, and \u0041, and with Array.prototype.reduce.5 min readraw property that holds the source text as written, with escapes left unprocessed. Here we look at the one tag that ships with the langu4 min readstrings array and its values, and how reduce without an initial value interleaves them. Both were covered earlier. Here we use that pattern for a real job: building HTML from untrusted data without opening a cross-site scripting hol5 min readstrings array and its values, and how reduce without an initial value interleaves them. It also assumes you know that a tag may return something other than a string. Basic SQL and some experience with a Node.js database driver will h5 min readstrings and ...values, how strings.raw relates to the cooked strings, and how WeakMap works. It covers a property of the strings array that earlier chapters only mentioned in passing. JavaScript creates the array once for each place i6 min readhtml or sql. The grammar allows more than that. The thing before the backtick can be any member expression: a property access, a computed property, a function call that returns a tag, or even another tagged template. This chapt5 min readstrings array and values, and that you understand the difference between cooked and raw strings from the earlier chapters. Here we look at one case where those two forms come apart: an escape sequence that JavaScript cannot interpret.5 min readreadonly arrays. All examples compile with strict enabled.4 min readhtml and sql tags, the strings/values split, cooked and raw strings, and call-site caching. Each pitfall below comes from something earlier chapters introduced as a feature.5 min read