LearnNewsExamplesServices
Frontmatter
id2443
titleSpreading default values
stateClosed
labels
enhancement
assigneestobiu
createdAtJun 21, 2021, 6:51 PM
updatedAtJun 21, 2021, 7:11 PM
githubUrlhttps://github.com/neomjs/neo/issues/2443
authortobiu
commentsCount0
parentIssuenull
subIssues[]
subIssuesCompleted0
subIssuesTotal0
blockedBy[]
blocking[]
closedAtJun 21, 2021, 7:11 PM

Spreading default values

Closed v8.1.0 enhancement
tobiu
tobiu commented on Jun 21, 2021, 6:51 PM

I am using the spread operator a lot:

let foo = {a:1, ...fooDefaults || {}}

I just noticed that it is a valid operation to spread null:

let foo = {a:1, ...null}

so we can reduce the code base a bit removing the || {} parts.

tobiu added the enhancement label on Jun 21, 2021, 6:51 PM
tobiu assigned to @tobiu on Jun 21, 2021, 6:51 PM
tobiu referenced in commit c9ad74a - "Spreading default values #2443" on Jun 21, 2021, 7:11 PM
tobiu closed this issue on Jun 21, 2021, 7:11 PM