Type inference derives a type from values and context without requiring every declaration to spell it out. The inferred type then constrains later operations.
The demo propagates number from a value to a variable and rejects a string method call. Explicit types can still clarify public functions and API boundaries.
When to use
Use it to keep local code concise while documenting external contracts explicitly.