Because Java is a statically typed language, compile-time checks are made on variable types. However, because JavaScript is a dynamically typed language, variables can contain any kind of value. This distinction has an impact on how each language handles errors and type-checks text.