One of my favorite uses for rest/spread is creating a new object that omits...


One of my favorite uses for rest/spread is creating a new object that omits one or more properties.

In this example, I created a vehicle object without the `id` property.

Simple.

Sometimes the linter complains if I destructure a property and don't use it.

In that case, I alias the field to start with an underscore. The leading underscore basically tells the linter "Chill out. I don't intend to use this field".

View original on X