If it’s an object and you want it to be a number, you’re going to have to chug through that in any programming environment. JS interpreters are capable of inferring that variables will be numbers throughout code.
A lot of what people say against JavaScript they already said against Java, it’s recycled.