However, there is one way which is particularly easy to implement. Simply place a ‘+’ before your variable to convert it to an integer.
const number = '123'
const convertedNumber = +number
If you don’t believe me you can test this by using ‘typeof’ on
convertedNumber and see the result in all its glory!
If you have anything further to add, please leave a comment below and let me know!