4 ms·
You should rephrase your first sentence since both arguments are required, and your statement can be interpreted otherwise.
by yelnatz 9y ago
You should rephrase your first sentence since both arguments are required, and your statement can be interpreted otherwise.
- reificator 9y agoI have never seen a browser that requires the radix, and MDN specifically calls out that you should pass both arguments or you will get unexpected results. They wouldn't need to do that if the radix was required. Now, should you treat the radix as optional? Absolutely not. I've got several commits on newly adopted codebases where I went through and explicitly used `10` as the radix anywhere `parseInt` was called. But is it technically optional? Absolutely. Proof: https://i.imgur.com/BnAiN8s.png https://i.imgur.com/BnAiN8s.png