Type declarations are not necessary when the type that is 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 prevents accidental type changes and makes code more explicit.