Posts

Showing posts with the label tsc

Typescript primitive types: any difference between the types “number” and “Number” (is TSC case-insensitive)?

Typescript primitive types: any difference between the types “number” and “Number” (is TSC case-insensitive)? I meant to write a parameter of type number , but I misspelled the type, writing Number instead. number Number On my IDE (JetBrains WebStorm) the type Number is written with the same color that is used for the primitive type number , while if I write a name of a class (known or unknown) it uses a different color, so I guess that somehow it recognizes the misspelled type as a correct/almost-correct/sort-of-correct type. Number number When I compile the code, instead of complaining for example that the compiler couldn't found a class named Number , TSC writes this error message: Number Illegal property access Does that mean that number and Number both co-exists as different types? number Number If this is true, which is the difference between those classes? If this is not the case, then why it simply didn't write the same error message it displays for unknown classes ...