3 ms·
Yes, but only if you're a JavaScript nerd: > parseInt("4s") + 1 5 (it was meant to be a feeble joke. I actually agree with you)
by pooriaazimi 14y ago
Yes, but only if you're a JavaScript nerd:
> parseInt("4s") + 1
5
(it was meant to be a feeble joke. I actually agree with you)
- danneu 14y agoDon't most languages parse strings like that? Ruby: "4s".to_i + 1 #=> 5
- pooriaazimi 14y agoI suppose you're right. I was so eager to bash JavaScript that I forgot about it. Come to think of it, I think even non-dynamic, traditional, old-school languages like C also parse string like this (`atoi("4s")`).