Hacker News new | ask | show | jobs
by WalterSear 3224 days ago
As a professional programmer, I've come to prefer code written to be understood by someone who started two weeks ago.
2 comments

In that case, don't write any code. Don't use function. Don't use React. Don't use lodash. Don't use third party library.

People who only start coding for two weeks can't understand any code.

People who start has enough experience to work, but only start in this project for two weeks, will understand "!!" idiom.

Then by that principle you'd want to use !! since casting via function or constructor differs more between languages.
What it looks like in other languages is only minorly relevant to its obviousness and readability.
I don't see the argument that Boolean(val) "reads easier" than !! as long as you know what !! does.
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?
Perhaps, but it's a primitive, not an object.