Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
pests
on Nov 9, 2023
|
parent
|
context
|
favorite
| on:
Interesting Bugs Caught by ESLint's no-constant-bi...
That is how it evaluates, not what the original author intended in the example in the OP.
return a === b ?? c;
The intent was
const bOrDefault = b ?? c; return a === bOrDefault;
You posted the actual (buggy) evaluation. I agree that its better if that is what you intend.
Consider applying for YC's Fall 2026 batch!
Applications
are open till July 27.
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search: