DEV Community

Discussion on: You should stop using `parseInt()`

Collapse
 
ky1e_s profile image
Kyle Stephens • Edited

Unless you're doing this in the order of hundreds of thousands, performance is neglible (I've rarely come across use cases like this in prod systems)

While it's nice to think about these things and how you write code, I will always push back on people looking to enforce issues or 'standards' like this in PRs because they're rather subjective POV on style or rely on contrived performance benefits. If this seems like a harsh response, I apologise, but I'm wary of articles with titles like you 'should' be doing this, or you 'must not' do this, etc.

Collapse
 
maxziebell profile image
Max Ziebell

This is so true. Instead of pushing back just add a math.round to the Number() and the readability suffers and probably the performance too. I agree, the suggested „optimization“ is not worth implementing and worth thinking about in most real world use cases.