News for hackers. Stuff that matters.
Re:JS1k demo: “Highway at Night” by jhgg on Sunday November 23, 2014 @03:36PM (#8649848)
It's a bit more than that. It can also be used to convert strings (containing numeric values) to Numbers. More commonly seen than the prefix "~~" is "|0", because of it's low order precedence.

    > '15'
    '15'
    > ~~'15'
    15
    > '15'|0
    15
    > 15.99|0
    15
    > ~~15 * 1.3
    19.5
    > 15 * 1.3 | 0
    19
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).