Introduction
Type inference helps the compiler guess the type of a value so you don't have to write it every time. This makes your code shorter and easier to read.
When you want to declare a variable without writing its type explicitly.
When you assign a value to a variable and want the compiler to figure out its type.
When you want cleaner code without losing type safety.
When working with functions that return values and you want the compiler to know the return type.
When you want to avoid clutter in your code but still keep it safe.