Of course you get to deal with a bit of FFI when calling built-in functionality of the browser.
(See CoffeeScript, TypeScript, Elm, etc. Or Transcrypt if you want pythonic semantics.)
I understand this being a business requirement made by a business droid. Other than that, there is really no reason to be married to JavaScript.