Templates, Tag Functions, and New String Features
T.J. Crowder · 2020
This chapter deals with ES2015's new template literals and template tag functions, plus new string features such as improved Unicode support, string iteration, and added methods. ES2015's template literals provide a way to create strings (and other things) using a literal syntax combining text and embedded substitutions. ES2015 markedly improved JavaScript's Unicode support, adding several features to strings and regular expressions to make working with the full Unicode character set simpler. In ES2015 onward, strings are iterable. The iteration visits each code point (rather than each code unit) in the string. ES2015 added a few handy utility methods to strings such as String.prototype.repeat, String.prototype. startsWith, and String.prototype. endsWith. The chapter also presents updates to the match, split, search, and replace methods.