Loading topic
=, and JavaScript fills each variable from the matching position on the right side. This chapter covers the core model: ho5 min read=. It gives the variable a value when the source has nothing useful at that position or property.5 min read...name at the end of a pat5 min readlet and const, write regular and arrow functions, and use common array methods such as map and reduce. It also builds on the previous chapter, where a rest element (...others) collected leftover values inside a destructuring pattern. A re5 min readlet and const, work with arrays, write and call functions, and tell a primitive value from a reference. It also builds on the previous chapter on rest parameters. Rest collects separate arguments into one array. Spread does the reverse: it *e5 min readlet and const, how to work with plain objects, and how array spread works from the previous chapter. You should also know the difference between primitive values and references.5 min readproperty: newName. Those topics were covered in earlier chapters. Here the patterns are nested: one pattern sits inside another so it can follow the shape of the data d4 min read[...arr]) and object spread ({ ...obj }) build new values, as covered in earlier chapters. It also assumes you know that JavaScript stores objects, arrays, and functions as references, while numbers, strings, and booleans are copied as values.5 min readconst [a, b] = ... or let { x } = .... Patterns also work in plain assignment, where they write into variables that already exist. That form is called destructuring assignment. It lets you swap values without a tem5 min read