Re:The many faces of undefined in JavaScript
by throwitaway1123 on Wednesday June 26, 2024 @05:15AM
(#40798001)
Some functions accept a callback and behave differently depending on whether or not the callback returns a value. If your callback is a single expression arrow function, then you might find it cleaner to just void the result instead of wrapping the body of the function in a code block (which prettier will format using multiple lines). Super contrived example:
The immer docs have a section about this pattern: https://immerjs.github.io/immer/return#inline-shortcuts-usin...
[ Parent
| on HN ]
There are no comments on this comment yet.