Learning Typescript Fudamentals
Learning Typescript Fudamentals
OF TYPESCRIPT 5.0+
https://www.panaverse.co/
https://github.com/panaverse/
https://www.youtube.com/@panaverse
https://www.facebook.com/groups/panaverse
Daniyal Nagori
About Instructor
TypeScript passed four languages (C, PHP, C# and C++) over the past six
years.
https://redmonk.com/sogrady/2021/08/05/language-rankings-6-21/
https://pypl.github.io/PYPL.html
Next.js 13 Now Supports TypeScript By Default
Next.js is the Most Demanded Full Stack Framework in 2023
https://redmonk.com/sogrady/2021/08/05/language-rankings-6-21/
Getting Started
Setting up your
environment
Setting up your environment
● There are many ways in which you can set up a coding environment. Such as:
○ Integrated Development Environment (IDE). Example: VS Code, Sublime Text, Atom, etc.
○ Web browser. Example: Chrome, Firefox, etc.
○ Online editor (optional). Example: StackBlitz, Replit, etc.
Install NodeJs and VS Code
https://nodejs.org/en/download/current/
node -v
https://code.visualstudio.com/
Install Typescript
https://www.npmjs.com/package/typescript
npm install -g typescript
tsc —init
Create a new file and name it whatever you want or better name it `index.ts` just for
convention.
Open your file in any text editor like vscode, notepad etc
First Typescript Program
Write the following code:
console.log("Hello World");
Run Typescript Program
tsc
node index.js
the terminal.
Writing code
● Formatting code:
○ Code needs to be formatted well. If you have a long file with many lines of code and you didn't
stick to a few basic formatting rules, it is going to be hard to understand what you've written.
○ The two most important rules for formatting the code are indentations and semicolons.
Fundamentals
Variables
Variables
TypeScript doesn’t use “types on the left”-style declarations like int x = 0; Type annotations will always go after the thing
being typed.
In most cases, though, this isn’t needed. Wherever possible, TypeScript tries to automatically infer the types in your code.
A new and fast way to deal with strings is Template Literals or Template String.
Advanced TypeScript:
https://github.com/panaverse/learn-typescript