Good catch, Chan — you're right about the TypeScript distinction here.
const x = 1 is normally inferred as the literal type 1, while let x = 1 widens to number. So if the lesson is trying to demonstrate plain number inference, let x = 1 is the cleaner example.
I’m recording this as a precision issue for inspection. Thank you for catching the difference between literal inference and widening — that is exactly the kind of detail TypeScript learners can trip over.
Hi Pippa,
In the Type Annotations and Inference lesson, the example says:
const x = 1 infers x: number
I think this example may be inaccurate. In TypeScript, const x = 1 is inferred as the literal type 1, not number.
Maybe let x = 1 would be a clearer example for x: number.