| Feature | Strongly Typed Languages | Loosely Typed Languages |
|---|---|---|
| Definition | Variables are bound strictly to a specific data type. | Variables are not bound strictly to a data type. |
| Type Safety | Enforces type rules strictly; prevents unintended operations. | Less strict; type conversions may happen automatically. |
| Error Detection | Many type errors are caught at compile-time (if compiled). | Errors may only appear at runtime due to implicit conversions. |
| Type Conversion | Requires explicit casting (e.g., int → string). | Performs implicit conversions (e.g., number → string automatically). |
| Example Languages | Java, C#, Swift, Rust | JavaScript, Python, PHP |
| Advantages | Fewer runtime errors, better maintainability, more reliable code. | Easier prototyping, faster to write, more flexible. |
| Disadvantages | More verbose, requires explicit type handling. | Higher chance of runtime bugs, harder to debug type-related issues. |
Strongly Typed (Java):
int num = 5;
num = "hello"; // ❌ Compile-time error
Loosely Typed (JavaScript):
let num = 5;
num = "hello"; // ✅ Allowed, now num is a string
Developed by Microsoft, TS is a strict syntactic superset of JS and adds optional static typing to the language.

Code of JS will work in TS but code of TS wont work in JS.
TS never runs in the web-browser, the browser only understands JS.
type-checking (similar to C++).
There are many TS Compilers, common ones are: