frontpage.
newsnewestaskshowjobs

Made with ♥ by @iamnishanth

Open Source @Github

fp.

Open in hackernews

The power of spread and rest patterns in JavaScript

https://allthingssmitty.com/2025/05/05/the-power-of-spread-and-rest-patterns-in-javascript.md/
2•AllThingsSmitty•6mo ago

Comments

dtagames•6mo ago
This syntax does look strange the first time you encounter it, especially since the same syntax is used for two very different things. But once I adopted this religion, every other way of working with array or object values (combining, cutting, rearranging, copying, etc.) seems like an anti-pattern. These operators turn complex iterative testing and copying operations into simple declarative values.