DEV Community

Discussion on: TypeScript is a waste of time. Change my mind.

Collapse
 
stereobooster profile image
stereobooster

static typed languages are those which the types are know at compile time

Right. If you open source code of almost any parser you would see that parser knows type of the value at the moment of parsing ("afsd" - string, 123 - number, etc.). By this definition JS is statically typed.

Dynamic typed languages means that types are determined during runtime

If you would use reflection in Java you would be able to determine type at runtime. So Java is dynamically typed.

Weak vs strong

Not CS terms.

Null isn't really a type

Null is a value. "Nullable" type represents set of one value.

type NullableNumber = number | null