Skip to content

Use coalesce operator for array#61

Merged
grahamc merged 2 commits intomainfrom
use-coalesce-for-array
Aug 26, 2024
Merged

Use coalesce operator for array#61
grahamc merged 2 commits intomainfrom
use-coalesce-for-array

Conversation

@lucperkins
Copy link
Copy Markdown
Member

@lucperkins lucperkins commented Aug 26, 2024

I didn't catch this on the last PR review, but in general we should strive to always use the coalesce operator rather than || when handling nulls and undefineds. In this particular case, an empty array is not falsy so this currently works as expected. But it's a good practice that we should enforce whenever we happen to catch it.

@netlify
Copy link
Copy Markdown

netlify bot commented Aug 26, 2024

Deploy Preview for detsys-ts-docs ready!

Name Link
🔨 Latest commit f3620cd
🔍 Latest deploy log https://app.netlify.com/sites/detsys-ts-docs/deploys/66cc8b124c7f6a00081868e5
😎 Deploy Preview https://deploy-preview-61--detsys-ts-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@lucperkins lucperkins changed the title use coalesce for array Use coalesce operator for array Aug 26, 2024
@grahamc grahamc enabled auto-merge August 26, 2024 14:03
@grahamc grahamc merged commit e8f6e8f into main Aug 26, 2024
@grahamc grahamc deleted the use-coalesce-for-array branch August 26, 2024 14:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants