What are the differences between this line:
var a = parseInt(\"1\", 10); // a === 1
and this line
var a = +\"1\"; // a ===
Consider performance too. I was suprised that parseInt
beats unary plus on iOS :) This is helpful for web apps with heavy CPU consumption only. As a rule-of-thumb I'd suggest JS opt-guys to consider any JS operator over another one from the mobile performance point of view nowadays.
So, go mobile-first ;)