Do you mean Duck Typing? (https://en.wikipedia.org/wiki/Duck_typing)
It is not a problem of Javascript; it is a powerful feature. It is the origin of advanced patterns like the MVC. Strict typing might help in some cases, but also leads to over-planning, over-typing, and irreducible wrong dependencies directions. Furthermore, once you have proper Testing, almost all problems with types disappear. That is Why the original Smalltalk developers created all our modern Testing tools. Just look to the SOLID principles, satisfying Liskov. Substitution Principle and Interface Segregation Principle is straight forward with Duck typing. That is the reason why Javascript succeeds where other languages have failed. By the way, Typescript retains many of the duck typing advantages.