Avoid unnecessary any casts in advanced types
Avoid unnecessary any casts in advanced types

- Tighten the typing to avoid unnecessary casts, especially casts to any.
- Use const where possible over mixture of let and var.
- Check Object.hasOwnProperty() in for..in loops.
- Add console.log() invocation so the example prints.

Microsoft/TypeScript-Handbook