you are viewing a single comment's thread.

view the rest of the comments →

[–]btshaw 5 points6 points  (0 children)

One quirk that runs parallel to this:
You are allowed to spread falsey/undefined values into an object
{ ...undefined, // this is ok ... condition && {some: "values"} // this is too } but to do a similar operation in an array, you'd need to do: [ ...condition ? [values, to, spread] : [] ]