// Longhand const quantity = parseInt("250") const price = parseFloat("432.50")
// Shorthand const quantity = +"250" // converts to int const price = +"432.50" // converts to float
I have a habbit of using parseInt parseFloat everytime.I would surely follow this shorthand.
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
// Longhand
const quantity = parseInt("250")
const price = parseFloat("432.50")
// Shorthand
const quantity = +"250" // converts to int
const price = +"432.50" // converts to float
I have a habbit of using parseInt parseFloat everytime.I would surely follow this shorthand.