Hacker News
new
|
past
|
comments
|
ask
|
show
|
jobs
|
submit
login
askmrsinh
54 days ago
|
parent
|
context
|
favorite
| on:
John Carmack on mutable variables
Why not do:
const y = x ? true : false;
stevage
54 days ago
|
next
[–]
I'm talking about cases with additional logic that's too long for a ternary.
1718627440
54 days ago
|
prev
[–]
That sounds like a more complicated way to write
const y = (bool)x;
or
const bool y = x;
Guidelines
|
FAQ
|
Lists
|
API
|
Security
|
Legal
|
Apply to YC
|
Contact
Search:
const y = x ? true : false;