Use some JS best practices

* Provide a `radix` parameter to `parseInt`.
* Fix a global leak.
* Fix a var declaration.
* Remove unneeded semicolons.
See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/parseInt

> 
radix
> An integer that represents the radix of the above mentioned string. Always specify this parameter to eliminate reader confusion and to guarantee predictable behavior. Different implementations produce different results when a radix is not specified.