1. What is TypeScript?
a. TypeScript is a syntactic superset of JavaScript which adds static typing. This basically means that TypeScript adds syntax on top of JavaScript, allowing developers to add types.
b. Syntactic Superset: means that it shares the same base syntax as JavaScript, but adds something to it.
c. TypeScript uses compile time type checking. Which means it checks if the specified types match before running the code, not while running the code
d. TypeScript allows specifying the types of data being passed around within the code, and has the ability to report errors when the types don't match.
2. TypeScript compiler
a. TypeScript compiles the code and convert the typescript into JavaScript.
Example: TypeScript file -> compiler -> JavaScript file
3. Difference between typescript and JavaScript
4. Challenges with JavaScript.
a. JavaScript is a loosely typed language. It can be difficult to understand what types of data are being passed around in JavaScript.
b. In JavaScript, function parameters and variables don't have any information! So developers need to look at documentation, or guess based on the implementation.
5. npm (Node Package Manager)
a. npm is also a software Package Manager and Installer
b. npm is the world's largest Software Library (Registry). The registry contains over 800,000 code packages.
c. npm is free to use. Mean it is open source.
d. npm includes a CLI (Command Line Client) that can be used to download and install software.
e. npm is installed with Node.js. This means that you have to install Node.js to get npm installed on your computer.
i. NodeJs -> include -> NPM -> include -> CLI and code packagees ->CLI is used to download and install software.
ii. Syntax: npm install <package>
6. Installing TypeScript Compiler
a. TypeScript can be installed through npm but first we need to install nodeJs so that we can have npm in our system.
Link to download NodeJs: https://nodejs.org/en/