Test name | Executions per second |
---|---|
No conversion | 12345770.0 Ops/sec |
parseInt | 4777230.0 Ops/sec |
Number | 4651345.0 Ops/sec |
var intA = 42.034;
var strB = "42.034";
var res = intA + strB;
var res = parseInt(intA) + parseInt(strB);
var res = Number(intA) + Number(strB);