Use some JS best practices

* Provide a `radix` parameter to `parseInt`.
* Fix a global leak.
* Fix a var declaration.
* Remove unneeded semicolons.
@sandinmyjoints the behaviour is clear to me, was the context that I miss, could be useful in some border case or not, this is my doubt.