I always had this question:
When i dont mind the exact floating number
Which one is preferred?
parseFloat
someValue = parseFloat(el.outerWidth())+parseFloat(ele2.css("marginRight")),
parseInt
someValue = parseInt(el.outerWidth(), 10)+parseInt(ele2.css("marginRight"), 10),
Which method is easier for the JS engine?
It’s as broad as it’s long really.
parseFloatis pointless here because the values will always be integers. I’d rather save on bytes and use the unary operator+: