Shadowing
Re-defining the same name with let.
Syntax
let x = ...; let x = ...;
Description
You can re-define the same name with let to change its value (or even its type) — this is different from mut.
Example
Loading editor…
Expected output
6
When to use?
Transforming a value and keeping it with the same name.