Javascript conversion to TypeScript. Commit before leaving.