explain TypeScript and Duck Typing
TypeScript is a typed superset of JavaScript that adds optional type annotations, class declarations, and object-oriented programming features. Duck Typing is a programming paradigm that allows for variable types to be determined dynamically at run-time. In Duck Typing, the behavior of an object is used to determine its type, rather than its declaration. This allows for more flexible typing and makes it easier to work with objects that may change type over time.
**TypeScript**

TypeScript is a superset of JavaScript that adds optional static typing and other features to improve the development experience. It was created by Microsoft in 2012 and is now maintained by the TypeScript team.

The main goals of TypeScript are:

1. **Improve code maintainability**: By adding type annotations, developers can better understand the codebase and catch errors early.
2. **Enhance code quality**: TypeScript's type system and other features help prevent common errors and improve code reliability.
3. **Support large-scale JavaScript applications**: TypeScript is designed to scale with large codebases and teams.

Key features of TypeScript include:

* **Static typing**: Developers can add type annotations to their code to specify the expected types of variables, function parameters, and return types.
* **Type inference**: TypeScript can automatically infer the types of variables and expressions based on their usage.
* **Interfaces**: TypeScript allows developers to define interfaces that specify the shape of objects, including their properties and methods.
* **Modules and dependencies**: TypeScript supports the use of modules and dependencies, making it easier to organize and manage code.
* **Compatibility with JavaScript**: TypeScript is fully compatible with existing JavaScript code, and developers can gradually migrate their codebases to TypeScript.

**Duck Typing**

Duck typing is a concept in programming that originates from the phrase "If it walks like a duck and quacks like a duck, then it's a duck." In other words, duck typing is a form of dynamic typing