I was wondering what the = +_ operator means in JavaScript. It looks like it does assignments.
Example:
hexbin.radius = function(_)
+_
is almost equivalent of parseFloat(_)
. Observe that parseInt
will stop at non numeric character such as dot, whereas parshFloat
will not.
EXP:
parseFloat(2.4) = 2.4
vs
parseInt(2.4) = 2
vs
+"2.4" = 2.4
Exp:
var _ = "3";
_ = +_;
console.log(_); // will show an integer 3
Very few differences:
""
evaluates to a 0
, while parseInt() evaluates to NaN