Type declarations are not necessary when the type inferred from the context exactly matches the type annotation, for example:
var pi: number = 3.14
In some cases it is preferable to always have explicit types - this saves from accidental type changes and makes code more explicit.