Loading topic
let and const, write functions, and run code in a browser console or Node.js. You should also know that arrays have methods such as push and reverse that change the array they are called on. The previous chapter showed how to create string 5 min readat method requires an ES2022 environment: Node.js 16.6+ or any curre4 min read ``) instead of quotes. It can hold embedded expressions and can span several lines. This chapter covers how interpolation works, how values become text inside a template, how multi-line templates handle whitespace, and the mistakes peopl5 min readindexOf, lastIndexOf, includes5 min readat, as covered in the chapter on length and indexing. It also assumes you have used the search methods indexOf and lastIndexOf. You will use those methods here to find the positions you cut at.4 min readtoUpperCase, toLowerCase and their locale-aware versions, the three trim methods, padStart and padEnd, and repeat. It assumes you can run JavaScript in Node.js or a browser console, know basic array method5 min readmap and filter, and run code in Node.js or a browser console. You should also know slice and indexOf from the earlier chapters. Regular expression syntax helps for one section, and a later chapter covers it in depth.4 min readindexOf and includes search text, and the basics of regular expression syntax such as character classes, quantifiers, and capture groups. Both methods covered here return a new string. The original string never changes, so you 4 min readindexOf and includes, which find fixed text. This chapter covers the three string methods that take a regular expression and return information about what matched: match, matchAll, and search. Replacing matched text was covered in the replace chapter, so this one i4 min readat, extract text with slice, and use split, join, and basic regular expressions. Earlier chapters treated a string as a row of characters. This chapter shows what JavaScript actually stores and where that simpler mo5 min readArray.prototype.sort with a compare function, and that you have read the earlier chapter on UTF-16 code units and normalization. You will learn why the default ordering of strings often looks wrong to people, and how localeCompare and Intl.Collator fix5 min read${} interpolation (covered earlier), rest parameters (...values), and Array.prototype.reduce. You should also be comfortable running snippets in Node.js or a browser console.5 min read"x" and new String("x") behave differently, why methods work on primitives anyway, and how 5 min readsplit and join, padStart and repeat, and how values are converted to strings, all from earlier chapters. You should also be comfortable with array methods such as map and with running code in Node.js or a browser console. The chapter covers 5 min read