GABRIEL CLEMENTE 👨🏼‍💻🟨’s Post

Think the `+` sign is only for adding numbers? Adorable. It's also a lightning-fast type cast. `const pages = +"50";` turns a string into a number. But feed it `"50 pages"` and it silently returns `NaN`, poisoning every calculation that follows. Is this a brilliant, high-performance tool, or a cryptic bug-factory that `parseInt()` was designed to prevent? #GaboTips #JavaScript

To view or add a comment, sign in

Explore content categories