No, Even JavaScript Has Types
Written at 2026-04-25 - Updated at 2026-06-10
2 + "2" becomes "22", and 2 * "11" becomes 22. In the end, "22" == 22 returns true. 🙂I sometimes see people say that programming languages like JavaScript, PHP, and Perl do not have types. Well, that’s simply not true. Yes, these languages do not enforce types at compile time. They are also not very strict about what you can do with those types. But they still have type systems. Every value has a type during execution. I think that if we define a type as “a classification of a value that determines how it can be used and how it behaves in operations,” then we can also say that it has types. Which means almost all of the mainstream programming languages you have heard of are already typed! JavaScript already supports types like strings, lists, numbers, and so on.
The main problem here is that JavaScript is just not as strict about what you can do with its types as other programming languages are, and I guess that is why some people think it does not have types. Because they see programming languages like C#, and people have to explicitly write things like string, int, bool, void, class, and so on all over the place, and they probably assume those are what types are.
If both a language like C# and JavaScript have types, then what explains the differences we see between them? Well, what differentiates them is how their type systems are implemented, not the mere existence of types themselves. A brief look at Basic Type System Terminology shows that we can simply examine type systems on two axes: Where and when the checks are performed (static vs dynamic), and how strictly those types are enforced (strong vs weak). There is obviously more to it than that, but I think this is a good starting point.
I think it is fair to say that none of the practical programming languages we use daily would be effective without types, or at least without some way to distinguish between the kinds of values they handle.
The closest thing to an “untyped” language I can think of is assembly. The bits you are operating on might represent completely different things: an integer, a floating-point value, or a memory address… The meaning depends entirely on how the programmer chooses to interpret them. But even then, I am not sure we can really call it “untyped”. It still operates on values with fixed sizes, such as 32-bit or 64-bit quantities. Maybe “one-typed” would make more sense there, but probably not quite right either.
Anyway, the thing is, the languages you use have types. Even the languages that do not seem to have types are typed. So, when someone says “TypeScript is JavaScript with types”, what they probably mean is that TypeScript adds a stricter type system. JavaScript already has types; it is just way too liberal with them.
I know this might seem like a trivial issue to some. If your main concern is just getting programs to run, why should it matter whether you call a language “typed” or not? If that is all you care about, it probably does not. But I think these distinctions start to make more sense once you begin learning other programming languages. They help you understand where a language sits relative to others and give you a rough idea of what to expect.
