Loosely typed and strongly typed languages

The main difference between using loosely typed languages and strongly typed languages

In programming, we call it a languageLoose typeWhen you don't have to explicitly specify the types of variables and objects.

A kindStrongly typedInstead, the language must specify the type.

There are advantages and disadvantages that you can argue forever, but the reality is that both methods are great in their intended context and usage.

JavaScript is loosely typed. You don't have to tell a string to be a string, and you don't need to require a function to accept an integer as its argument.

This provides great flexibility for JavaScript. Flexibility allows you to move faster, change things quickly, and iterate faster.

On the contrary, a powerful type system provides more structure for the program. For example, in team work, a programmer cannot really remember all the code base, and using types helps to maintain the code, which will be a great help . Manageable.

This is a typical compiled language (while famous dynamic languages such as JavaScript, Python and Ruby are loosely typed).

You can use some of the flexibility that loosely typed languages provide you to gain greater security and trust in the code base.

Because of the type, the compiler can detect errors at compile time rather than at runtime, making it easier to write code that meets your requirements (and makes the testing phase slightly easier, although nothing can make your program perfect).

TypescriptIt is a good example of a strongly typed language. It can be compiled into JavaScript, providing you with the advantages of the JavaScript platform and the expected advantages of the type. C, Go, Java, and Swift are great examples of strongly typed languages.

As I have seen in my article, the input type is not loose, of course, does not mean that you have no type.JavaScript typepostal. You can imagine its advantages and disadvantages just by using types implicitly.

Download mine for freeJavaScript beginner's manual


More js tutorials: