Toggle navigation
VR AR News
beta
Blog
Suggest a feed
Feedback
About
Sunday, 5 April, 2020
UTC
I Prefer The Unary Plus (+) Operator Over parseInt() And ParseFloat() When Coercing Strings To Numbers In JavaScript
Summary
Ben Nadel favors the unary plus operator (+) over the parseInt() and parseFloat() methods in JavaScript when trying to coerce String values into Number values. It's short; fails more consistently; and maps closer to his intent....
... more @ bennadel.com
bennadel.com