sdleihssirhc — 2010-03-03T01:50:52-05:00 — #1
I see some scripts put two tildes in front of variables, like so:
var a = ~~b;
As far as I can tell, all this does is ensure that a is given a number value. But is there a reason to prefer ~~ over +?
var a = +b;
Or is there something else going on?
scallioxtx — 2010-03-03T02:50:46-05:00 — #2
Never knew that one.
Looked it up, and it does -(N+1)
So, if you have 1 ~~"2", you get the following:
felgall — 2010-03-03T03:47:43-05:00 — #3
stomme_poes — 2010-03-03T03:52:33-05:00 — #4