DEV Community


Discussion on: Javascript in a Ninja Way

ryanpwalker profile image
Ryan Walker

const num1 = +"100" Does this shorthand work in all browsers?

deepanmania profile image
Deepan Author

It's just usage of a unary operator '+'. So, I believe it will work the same on all browsers. But you cannot use const, instead of const use var since const is introduced in ES6.