DEV Community

Boots
Boots

Posted on

2

Twenty-second article! An important difference between parseInt and + in javascript

I'll be brief!

  • parseInt('.3', 10)
    • returns NaN
  • +'.3'
    • returns 0.3 (a Number)

The + operator might be slower than parseInt, but it's a bit more intuitive imo... and my goodness the title was almost as long as the article itself.

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more