Sep 5, 2018 · 1 min read
Great, clever use of the spread operator! I hadn’t realised that pretty much any expression can be used with the …
In your use case, if the left side expression is falsy, really the spread operator applies to that value, so,
…(’’ && {field: ‘value’})
Equals
…(’’)
And that actually is accepted by the parser. Nice trick!
