I don't understand why casting method +value is bad thing.
I saw this #transfer value to boolean issue because this guide says casting to boolean with !!value is best! But, Why +value is not? I need something deep explanation.
Thank you.
+value and Number(value) are the same, as is !!value and Boolean(value).
However, ‼ has a huge precedence across many programming languages and logic systems to mean double negation - whereas + to cast to a number isn't nearly as universal.
I'd say that + and !! are both syntactic and thus more robust - however, using Number() is clearer than +, but Boolean() and !! are equally clear, and clarity is the most important thing. Therefore, I'd say you should use !! and Number().
@ljharb Okay, The cause is just that + isn't as universal.. I got it! Thank you!