Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use coalesce operator for array #61

Merged
merged 2 commits into from
Aug 26, 2024
Merged

Use coalesce operator for array #61

merged 2 commits into from
Aug 26, 2024

Conversation

lucperkins
Copy link
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.

Copy link

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
5 checks passed
@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