Y
Hacker News
new
|
ask
|
show
|
jobs
by
debaserab2
3231 days ago
Then by that principle you'd want to use !! since casting via function or constructor differs more between languages.
1 comments
WalterSear
3231 days ago
What it looks like in other languages is only minorly relevant to its obviousness and readability.
link
debaserab2
3231 days ago
I don't see the argument that Boolean(val) "reads easier" than !! as long as you know what !! does.
link
goatlover
3231 days ago
Wouldn't any programmer recognize that Boolean(val) is a cast to a True/False value that's most likely an object, given the uppercase?
link
inimino
3230 days ago
Perhaps, but it's a primitive, not an object.
link