basarat / basarat/typescript-book
Truthy conversion: swtich from double negation to Boolean?
Open
- Dominant language
- TypeScript
- Stars
- 21.6k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Looking at https://github.com/basarat/typescript-book/blob/120b111141abcffca11e63aa98639fb7d66073a6/docs/javascript/truthy.md?plain=1#L27 I see the book is using the `!!` for converting something to an explicit boolean value, which is always a bit hacky to read.
What about using the `Boolean` operator instead?
Contributor guide
Research direction
Open docs/javascript/truthy.md at the linked line and review the current example using double negation for explicit boolean conversion. Compare it with the proposed Boolean operator and update the example or explanation if appropriate, keeping the surrounding truthy-value guidance accurate.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100