Obviously, this will lead to serious issues down the road. Terrible just terrible.
If this article makes Typescript sound interesting, you can delve more into Typescript and see if you its something you want to invest time and energy into. This is just a very brief article talking about these tools in a very peripheral manner.
Here is Javascript Dynamically typed