Every programming language employs a type system in order to assign a type to each variable declared in the code. These type systems can be divided into two categories: static and dynamic.
Statically-typed languages require you to declare the data types of your variables before you use them. A variable has its type determined at compile-time and that type does not change throughout the lifespan of the variable. Examples of statically-typed languages include Java and C#.
// Static typing in Java int num = 100; char a = 'a';
In contrast, dynamically-typed languages allow a variable to have different types through its lifetime.
Dynamic typing can lead to coercion of values into other types during certain operations such as comparison.
When checking for equality, stick with the strict equality operator (===) so the interpreter will compare both the value and the type.