News for hackers. Stuff that matters.
Re:JS1k demo: “Highway at Night” by owenversteeg on Sunday November 23, 2014 @08:52PM (#8650679)
Everyone I know uses the + operator, I rarely see others. Funny that I'm not seeing + here.
Re:JS1k demo: “Highway at Night” by tracker1 on Sunday November 23, 2014 @09:30PM (#8650783)
With ~~foo you will always get an integer that fits inside a 32-bit integer range... regardless of the input... invalid numbers will be 0. Whereas with a +foo you may get NaN (for an invalid decimal input).

Part of this is because bitwise operations will convert whatever the input value is to a 32-bit integer value before performing the operation, and not fail (invalid input becomes 0 opposed to NaN).