
#Day4 - Type Annotation vs Type Inference
1 September, 2022
0
0
0
Contributors
Type Annotation
Type Annotation means we explicitly tell the Typescript about the type.
Type Inference
Type Inference means we didn't tell the type, but let Typescript figure it out. From the code above, we don't write the type of website variable, but the initial value of it are string. So, when
So, when we try to reassign it with another type, TS will throw an error.