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

Correct bad advice on undefined conversion #518

Merged
merged 1 commit into from
Dec 4, 2024

Conversation

martinthomson
Copy link
Contributor

@martinthomson martinthomson commented Dec 4, 2024

As noted in #437, simple advice to treat absence as equivalent to being passed undefined is a mistake. This advice only really applies to Boolean arguments.

We discussed and concluded that string and number arguments have no sensible default that we could recommend. Booleans do.

Closes #437.


Preview | Diff

As noted in #437, simple advice to treat absence as equivalent to being
passed `undefined` is a mistake.  This advice only really applies to
Boolean arguments.

We discussed and concluded that string and number arguments have no
sensible default that we could recommend.  Booleans do.

Closes #437.
@martinthomson martinthomson merged commit b2c1996 into main Dec 4, 2024
@martinthomson martinthomson deleted the undefined-is-not-converted branch December 4, 2024 11:01
martinthomson added a commit that referenced this pull request Dec 4, 2024
As noted in #437, simple advice to treat absence as equivalent to being
passed `undefined` is a mistake.  This advice only really applies to
Boolean arguments.

We discussed and concluded that string and number arguments have no
sensible default that we could recommend.  Booleans do.

Closes #437.
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.

"Make method arguments optional if possible" section has bad advice
2 participants