Took a lot of time to write these. Please subscribe. Github Repo: github.com/hiteshchoudhary/typescript-youtube-22 00:00:00 - 00:06:51 - Why to learn typescript 00:06:51 - 00:15:08 - Typescript is not what you think 00:15:08 - 00:27:16 - How to install typescript 00:27:16 - 00:39:04 - Your first intro to typescript docs 00:39:04 - 00:46:35 - Number, boolean and type inference 00:39:04 - 00:46:35 - Number, boolean and type inference 00:46:35 - 00:51:13 - Don't use ANY in typescript 00:51:13 - 01:02:38 - Do you really know functions in typescript 01:02:38 - 01:15:21 - A better way to write function in typescript 01:15:21 - 01:24:57 - Bad behaviour of objects in typescript 01:24:57 - 01:32:11 - Type Aliases in Typescript 01:32:11 - 01:41:56 - READONLY and optional in typescript 01:41:56 - 01:49:46 - Array in Typescript 01:49:46 - 02:04:29 - Union Types in TS 02:04:29 - 02:14:16 - Tuples in typescript 02:14:16 - 02:23:46 - Enums in typescript 02:23:46 - 02:33:35 - interface in typescript 02:33:35 - 02:38:51 - Interface vs Type in typescript 02:38:51 - 02:53:27 - How to setup Typescript for real projects 02:53:27 - 03:01:49 - Classes in typescript 03:01:49 - 03:07:55 - Private Public in Typescript 03:07:55 - 03:15:08 - Getters and Setters in typescript 03:15:08 - 03:19:17 - Protected in Typescript 03:19:17 - 03:25:48 - Why Interface is important in typescript 03:25:48 - 03:35:19 - Abstract class in Typescript 03:35:19 - 03:47:41 - Generics in Typescript 03:47:41 - 03:55:50 - Generics in Array and Arrow functions in Typescript 03:55:50 - 04:06:59 - Generic Classes in Typescript 04:06:59 - 04:16:47 - Type Narrowing in typescript 04:16:47 - 04:22:00 - The in operator narrowing 04:22:00 - 04:31:18 - Instanceof and Type Predicates 04:31:18 - 04:42:37 - Discriminated Union and Exhaustiveness Checking with never 04:42:37 - 04:46:07 - Typescript End
if you are from odisha hit likes 00:00:00 - 00:06:51 - Why to learn typescript 00:06:51 - 00:15:08 - Typescript is not what you think 00:15:08 - 00:27:16 - How to install typescript 00:27:16 - 00:39:04 - Your first intro to typescript docs 00:39:04 - 00:46:35 - Number, boolean and type inference 00:39:04 - 00:46:35 - Number, boolean and type inference 00:46:35 - 00:51:13 - Don't use ANY in typescript 00:51:13 - 01:02:38 - Do you really know functions in typescript 01:02:38 - 01:15:21 - A better way to write function in typescript 01:15:21 - 01:24:57 - Bad behaviour of objects in typescript 01:24:57 - 01:32:11 - Type Aliases in Typescript 01:32:11 - 01:41:56 - READONLY and optional in typescript 01:41:56 - 01:49:46 - Array in Typescript 01:49:46 - 02:04:29 - Union Types in TS 02:04:29 - 02:14:16 - Tuples in typescript 02:14:16 - 02:23:46 - Enums in typescript 02:23:46 - 02:33:35 - interface in typescript 02:33:35 - 02:38:51 - Interface vs Type in typescript 02:38:51 - 02:53:27 - How to setup Typescript for real projects 02:53:27 - 03:01:49 - Classes in typescript 03:01:49 - 03:07:55 - Private Public in Typescript 03:07:55 - 03:15:08 - Getters and Setters in typescript 03:15:08 - 03:19:17 - Protected in Typescript 03:19:17 - 03:25:48 - Why Interface is important in typescript 03:25:48 - 03:35:19 - Abstract class in Typescript 03:35:19 - 03:47:41 - Generics in Typescript 03:47:41 - 03:55:50 - Generics in Array and Arrow functions in Typescript 03:55:50 - 04:06:59 - Generic Classes in Typescript 04:06:59 - 04:16:47 - Type Narrowing in typescript 04:16:47 - 04:22:00 - The in operator narrowing 04:22:00 - 04:31:18 - Instanceof and Type Predicates 04:31:18 - 04:42:37 - Discriminated Union and Exhaustiveness Checking with never 04:42:37 - 04:46:07 - Typescript End
I need to say that after watching the entire almost 5 hours tutorial it is one of the best and I can't wait tomorrow to start writing and applying everything I have learned. Thank you very much.
1:36:17 In TypeScript, if an array is declared as readonly, you cannot use the push method to add new elements to it. This is because the readonly modifier prevents any modifications to the array. Instead, you can use the spread operator (...) to create a new array with the additional elements, like this: TypeScript let arr: readonly number[] = [1, 2, 3]; arr = [...arr, 4, 5]; // creates a new array [1, 2, 3, 4, 5] Note that this creates a new array, rather than modifying the original one.
I usually don’t finish long tutorials, but this is the first video I’ve ever completed-and I did it in just two days. You made the content so interesting and easy to follow. Thanks for all the effort you put into it! 💙
Yes, we can push inside the _id if it is an array because the array is concerned with its reference and not the values present inside it here even if you push some values inside it the reference will remain the same .
2:14:40 , its enumerations and it means calling/naming one by one and this is actually what happens when we define an enum, we simply name the props we want this new custom data_type (for say) to have
I know many programming languages, more than 10, almost every popular language. I would just say that Type is very very important. My favorite language is Java and it has a wide range of type declaration. Now i finally love javascript with Typescript. Without Typescript will javascript very buggy and will waste too much time to find a small error. I think, typescript is a must because it really helps.
Hi Hitesh, You explain these concepts so well man ❤, I really want to learn that too(communication and soft skills). Can you please make a course on that too?🙂
Hi Hitesh, Thank you for giving this great detailed course. I not only found this course useful, the takeaway was how to read the document and make hands-on all along the way 😇👍
2:23:40 The full form of enum in TypeScript is "Enumerated Type". Here's an example of using an enum in TypeScript: TypeScript // Define an enum enum Day { Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday } // Use the enum let today: Day = Day.Sunday; console.log(today); // Output: 0 // Use the enum in a switch statement switch (today) { case Day.Sunday: console.log('Today is Sunday'); break; case Day.Monday: console.log('Today is Monday'); break; default: console.log('Today is another day'); } // Use the enum with a string value enum Color { Red = 'red', Green = 'green', Blue = 'blue' } let favoriteColor: Color = Color.Green; console.log(favoriteColor); // Output: green In this example, we define two enums: Day and Color. The Day enum has numeric values, while the Color enum has string values. We then use the enums to declare variables, log messages, and handle different cases in a switch statement. Note that enums can also be used as a type annotation to restrict the type of a variable or property: TypeScript let day: Day = Day.Sunday; In this case, the day variable can only be assigned a value from the Day enum.
Hi Hitesh, We have watched your TYPESCRIPT series. And, It will be very nice, If you will have showed us "How we use TYPESCRIPT in real-world APPLICATIONS and frameworks like REACT, and server-side as well like when writing the EXPRESS js, SO that, we can do the projects using TYPESCRIPT by replacing JAVASCRIPT. So, please share with us the small chunks of projects in REACT AND EXPRESS in your content. Thank YOU!
Excellent video bro. I loved it and it helped me to eliminate certain doubts. Thank you very much. When do you do a complete and practical React project with typescript?
coming from java, kotlin and dart, it is easier to directly learn Typescript first (without learning javascript). It is kinda like Kotlin syntax which is superb.
1:36:21 Because we are storing an address of array's first value, technically we are not changing the array address when we push or pop elements from array
One of the best video on typescript ranked number 1 as per me. Thank You so much sir for making ease and every concept as buttery . Thank you so muchhhhhhhhh.......................
Hi Hitesh sir, it was a extremely excellent tutorial and was really helpful. There was a minor issue at 1:58:52. As it is a function, just adding `return` resolves the error.
Thanks you so much sir so making amazing content i have no words to your hard work keep making amzing content again thanks alot for this video alot love and respect from karachi pakistan thank you so much
2:12:22 I am watching this after a year and now I can not push the new type of value in that array . It is fixed . It is saying Argument of type 'boolean' is not assignable to parameter of type 'string | number'.
Firstly thank u for the course. Sir at 2:12:23 newUser is following type User but you have written newUser[1] instead of newUser[0] that's why not giving an Error.
Hey Hitesh, I really like the way you are teaching. Glad to find you. I have one suggestion regarding 1:58. Typescirpt is yelling at you because you forgot to "return: id.toLowerCase()" TS could not correctly infer return value so it assumed it will be still "string | number" so we can not apply + operator :) You may consider to update that scene :) Greetings
while I am trying to understand the documentation of anything I thought about how they understand that, is there any approach to reading the documentation ? or we are lacking the experience.
2:50:00 i have no clue why but i dont see any console lines in the browser i tried different browsers and i followed every step, this is so frustrating the background color change worked
In React js, How can we write TYPESCRIPT and use that in HOOKS like usState, and useEffect, Can we write Interfaces, Please cover all these topics in your future content. Thank you.
Hi Hitesh I have one question 1:24:45 at the moment you did not mention type for that parameters in createuser function, you just provide the alias for parameter that's why it is not through any error. Please correct me if I am wrong.
1:43:22 my online TS compiler doesnt give me error for this operation, I was even able to console.log the value and got spiderman correctly, Is this some new update?
Took a lot of time to write these. Please subscribe.
Github Repo:
github.com/hiteshchoudhary/typescript-youtube-22
00:00:00 - 00:06:51 - Why to learn typescript
00:06:51 - 00:15:08 - Typescript is not what you think
00:15:08 - 00:27:16 - How to install typescript
00:27:16 - 00:39:04 - Your first intro to typescript docs
00:39:04 - 00:46:35 - Number, boolean and type inference
00:39:04 - 00:46:35 - Number, boolean and type inference
00:46:35 - 00:51:13 - Don't use ANY in typescript
00:51:13 - 01:02:38 - Do you really know functions in typescript
01:02:38 - 01:15:21 - A better way to write function in typescript
01:15:21 - 01:24:57 - Bad behaviour of objects in typescript
01:24:57 - 01:32:11 - Type Aliases in Typescript
01:32:11 - 01:41:56 - READONLY and optional in typescript
01:41:56 - 01:49:46 - Array in Typescript
01:49:46 - 02:04:29 - Union Types in TS
02:04:29 - 02:14:16 - Tuples in typescript
02:14:16 - 02:23:46 - Enums in typescript
02:23:46 - 02:33:35 - interface in typescript
02:33:35 - 02:38:51 - Interface vs Type in typescript
02:38:51 - 02:53:27 - How to setup Typescript for real projects
02:53:27 - 03:01:49 - Classes in typescript
03:01:49 - 03:07:55 - Private Public in Typescript
03:07:55 - 03:15:08 - Getters and Setters in typescript
03:15:08 - 03:19:17 - Protected in Typescript
03:19:17 - 03:25:48 - Why Interface is important in typescript
03:25:48 - 03:35:19 - Abstract class in Typescript
03:35:19 - 03:47:41 - Generics in Typescript
03:47:41 - 03:55:50 - Generics in Array and Arrow functions in Typescript
03:55:50 - 04:06:59 - Generic Classes in Typescript
04:06:59 - 04:16:47 - Type Narrowing in typescript
04:16:47 - 04:22:00 - The in operator narrowing
04:22:00 - 04:31:18 - Instanceof and Type Predicates
04:31:18 - 04:42:37 - Discriminated Union and Exhaustiveness Checking with never
04:42:37 - 04:46:07 - Typescript End
Make one more 5+ hours video on projects using typescript 💯
Hitesh, you really posted a good course here so far👍👍
Thank you
if you are from odisha hit likes
00:00:00 - 00:06:51 - Why to learn typescript
00:06:51 - 00:15:08 - Typescript is not what you think
00:15:08 - 00:27:16 - How to install typescript
00:27:16 - 00:39:04 - Your first intro to typescript docs
00:39:04 - 00:46:35 - Number, boolean and type inference
00:39:04 - 00:46:35 - Number, boolean and type inference
00:46:35 - 00:51:13 - Don't use ANY in typescript
00:51:13 - 01:02:38 - Do you really know functions in typescript
01:02:38 - 01:15:21 - A better way to write function in typescript
01:15:21 - 01:24:57 - Bad behaviour of objects in typescript
01:24:57 - 01:32:11 - Type Aliases in Typescript
01:32:11 - 01:41:56 - READONLY and optional in typescript
01:41:56 - 01:49:46 - Array in Typescript
01:49:46 - 02:04:29 - Union Types in TS
02:04:29 - 02:14:16 - Tuples in typescript
02:14:16 - 02:23:46 - Enums in typescript
02:23:46 - 02:33:35 - interface in typescript
02:33:35 - 02:38:51 - Interface vs Type in typescript
02:38:51 - 02:53:27 - How to setup Typescript for real projects
02:53:27 - 03:01:49 - Classes in typescript
03:01:49 - 03:07:55 - Private Public in Typescript
03:07:55 - 03:15:08 - Getters and Setters in typescript
03:15:08 - 03:19:17 - Protected in Typescript
03:19:17 - 03:25:48 - Why Interface is important in typescript
03:25:48 - 03:35:19 - Abstract class in Typescript
03:35:19 - 03:47:41 - Generics in Typescript
03:47:41 - 03:55:50 - Generics in Array and Arrow functions in Typescript
03:55:50 - 04:06:59 - Generic Classes in Typescript
04:06:59 - 04:16:47 - Type Narrowing in typescript
04:16:47 - 04:22:00 - The in operator narrowing
04:22:00 - 04:31:18 - Instanceof and Type Predicates
04:31:18 - 04:42:37 - Discriminated Union and Exhaustiveness Checking with never
04:42:37 - 04:46:07 - Typescript End
Thanks for this. Can you please help same for cpp video?
I need to say that after watching the entire almost 5 hours tutorial it is one of the best and I can't wait tomorrow to start writing and applying everything I have learned. Thank you very much.
1:36:17
In TypeScript, if an array is declared as readonly, you cannot use the push method to add new elements to it. This is because the readonly modifier prevents any modifications to the array.
Instead, you can use the spread operator (...) to create a new array with the additional elements, like this:
TypeScript
let arr: readonly number[] = [1, 2, 3];
arr = [...arr, 4, 5]; // creates a new array [1, 2, 3, 4, 5]
Note that this creates a new array, rather than modifying the original one.
I usually don’t finish long tutorials, but this is the first video I’ve ever completed-and I did it in just two days. You made the content so interesting and easy to follow. Thanks for all the effort you put into it! 💙
Yes, we can push inside the _id if it is an array because the array is concerned with its reference and not the values present inside it here even if you push some values inside it the reference will remain the same .
The best coding teacher on Internet! Thanks Hitesh Sir! Great tutorial! Great Human with Great Attitude.
It's so annoying for those whole subscribed already!
2:14:40 , its enumerations and it means calling/naming one by one and this is actually what happens when we define an enum, we simply name the props we want this new custom data_type (for say) to have
Completed the whole video. It took me 3 days to complete this but it was worth it. Thanks for posting this.
Happy to help,
Took me months to create this playlist
@@HiteshCodeLab These videos get less views but are so important. People get carried away with 50LPA clickbait videos.
01:36:35 Q] if id would be array. can we push values to array in case of READONLY?
ans: yes we push value in array
My man Hitesh, thank you for taking out time for making this course. This is timeless.
I know many programming languages, more than 10, almost every popular language.
I would just say that Type is very very important. My favorite language is Java and it has a wide range of type declaration. Now i finally love javascript with Typescript. Without Typescript will javascript very buggy and will waste too much time to find a small error. I think, typescript is a must because it really helps.
Thank you so much for this course! Tried other ones but this was the most interesting and enjoyable so far!
Took 10+ Days but finished indeed. Thank you sir for this amazing course.
Finally, I completed this entire series. thank you so much for a great explanation 😍👍
Hi Hitesh,
You explain these concepts so well man ❤, I really want to learn that too(communication and soft skills).
Can you please make a course on that too?🙂
Hi Hitesh, Thank you for giving this great detailed course. I not only found this course useful, the takeaway was how to read the document and make hands-on all along the way 😇👍
Thanks
Thank for sharing this fundational content Hitesh, I hope you get the 1M subcribers in this year and wish u all my best dear teacher!
Please make a complete video aswell for react testing like this one, i loved to follow a complete series like this, thanks hitesh 👍
2:23:40
The full form of enum in TypeScript is "Enumerated Type".
Here's an example of using an enum in TypeScript:
TypeScript
// Define an enum
enum Day {
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
}
// Use the enum
let today: Day = Day.Sunday;
console.log(today); // Output: 0
// Use the enum in a switch statement
switch (today) {
case Day.Sunday:
console.log('Today is Sunday');
break;
case Day.Monday:
console.log('Today is Monday');
break;
default:
console.log('Today is another day');
}
// Use the enum with a string value
enum Color {
Red = 'red',
Green = 'green',
Blue = 'blue'
}
let favoriteColor: Color = Color.Green;
console.log(favoriteColor); // Output: green
In this example, we define two enums: Day and Color. The Day enum has numeric values, while the Color enum has string values. We then use the enums to declare variables, log messages, and handle different cases in a switch statement.
Note that enums can also be used as a type annotation to restrict the type of a variable or property:
TypeScript
let day: Day = Day.Sunday;
In this case, the day variable can only be assigned a value from the Day enum.
Hi Hitesh, We have watched your TYPESCRIPT series. And, It will be very nice, If you will have showed us "How we use TYPESCRIPT in real-world APPLICATIONS and frameworks like REACT, and server-side as well like when writing the EXPRESS js, SO that, we can do the projects using TYPESCRIPT by replacing JAVASCRIPT. So, please share with us the small chunks of projects in REACT AND EXPRESS in your content. Thank YOU!
Types: (1) String (2) Number (3) Boolean (4) Array (5) Any (6) Object (7) Union (8) Literal (9) null (10) undefined
Thanks :)
Excellent video bro. I loved it and it helped me to eliminate certain doubts. Thank you very much. When do you do a complete and practical React project with typescript?
coming from java, kotlin and dart, it is easier to directly learn Typescript first (without learning javascript). It is kinda like Kotlin syntax which is superb.
38:43 - typescript types-> string, boolean, number, array, any, object, union, literal, null, undefined, enums
Your teaching is of a different level... I love the way you explain things..thanks for this awesome video sir
1:36:21 Because we are storing an address of array's first value, technically we are not changing the array address when we push or pop elements from array
Thank you so much for this course! I just complete this whole Typescript Series.
Best Course. Thanks for giving us your valuable time
It will be great if you put timeline in description ❤️
Working on it, it will be available soon
@@HiteshCodeLab you can create segments
@@HiteshCodeLab thanks you did👍👍
One of the best video on typescript ranked number 1 as per me. Thank You so much sir for making ease and every concept as buttery . Thank you so muchhhhhhhhh.......................
Thank you Hitesh! Perfect as always.
Thank you Hitesh for great content. You are really good at teaching.
I wish you get a million subscribers soon. Cheering your channel. Good luck.
Thank you so much for creating this course with great details. It was awesome and simple to udnerstand.
Hi Hitesh sir, it was a extremely excellent tutorial and was really helpful.
There was a minor issue at 1:58:52. As it is a function, just adding `return` resolves the error.
Thanks for pointing it out. It helps
You deserve payment, yet your crash courses are knowledge source for the beginners!! CZcams Thanks.
2days ago I was thinking of typescript, but couldn't found a course. Now here we go
feels like i am gonna master TypeScript here only !!
Your way of explaining was very good. Thank you for this tutorial. 👏
@1:36:24 Yes we can push value inside the read-only ids array
Okay
This is best typescript tutorial on CZcams,
thank you Sir.
Thanks
Hnji hum idhar bhi aa Gaye to learn something new 👍👍
What about typescript utility like Partial, Required, Pick, Readonly and Omit
13:36 Here I almost cried thought my laptops life is done.
Hi Hitesh, thank you very much for this tutorial. The presentation was awesome and simple to understand😀
Thanks you so much sir so making amazing content i have no words to your hard work keep making amzing content again thanks alot for this video alot love and respect from karachi pakistan thank you so much
This tutorial is helping me alot in knowing typescript
Thanks
2:12:22 I am watching this after a year and now I can not push the new type of value in that array . It is fixed . It is saying
Argument of type 'boolean' is not assignable to parameter of type 'string | number'.
Please let me know the font family you are using in vs code ? It looks good. 😊
Great tutorial, watched upto end.
Sir did you add project in this video ? So that we can get better understanding of typescript concepts like interfaces, generics etc
timestamps or index would be great, sir🙌
Thank you so much for this amazing series!
Yes , we can push elements in array if _id is an array type
post video about how to finetune ChatGPT Model for specific usecase with website or mobile integration to work as customer care chatbot....
I like the way you teach and speak, you are lovely.
Firstly thank u for the course. Sir at 2:12:23 newUser is following type User but you have written newUser[1] instead of newUser[0] that's why not giving an Error.
May be now it is settled
thanks sir
take love from Bangladesh 🇧🇩🇧🇩🇧🇩
Amazing video sir learnt a lot
1:36:16
Readonly throw error on array and tuple mutation
function foo(arr: readonly string[]) {
arr.slice(); // okay
arr.push("hello!"); // error!
}
thanks for this one sir
love you from bangladesh..❤❤❤
Thanks man ..
Yesterday thinking about it, to buy that course now it's free 😂
Thank your sir, impressive way of teaching
Hey Hitesh, I really like the way you are teaching. Glad to find you. I have one suggestion regarding 1:58. Typescirpt is yelling at you because you forgot to "return: id.toLowerCase()" TS could not correctly infer return value so it assumed it will be still "string | number" so we can not apply + operator :) You may consider to update that scene :) Greetings
Wonderful tutorial Hiteshji 🙏🙏🙏
hey @Hitesh can you Do like this with GCP. That will be very grateful.Thanks
while I am trying to understand the documentation of anything I thought about how they understand that, is there any approach to reading the documentation ? or we are lacking the experience.
Hitesh you are the best dude,keep it up please thank you🙏
01:02:38 - 01:15:21 - A better way to write function in typescript
2:50:00 i have no clue why but i dont see any console lines in the browser
i tried different browsers and i followed every step, this is so frustrating
the background color change worked
Waiting for this video to hit 1 million vies 💯
That’s not happening anytime soon😂
hi Hitesh, Can you please explain why you have added export{} at the end of code to remove errors from code.I did not get it
Wow, great sir 👏👏👏👍
but i think you forgot to put those CZcams timestamp thingy so we can refer back to a particular topic in this long video.
Just did that
In React js, How can we write TYPESCRIPT and use that in HOOKS like usState, and useEffect, Can we write Interfaces, Please cover all these topics in your future content. Thank you.
I would be great if you teach decorators in TS :)
Please like, share and subscribe guys. Hitesh did an outstanding work in this tutorial
Hello ,I need to learn typescript and playwright automation. How much javascript depth is required? Thank you 🙏
I'm watching this on 4th April 2024 can i still follow along the video to learn TS?
Hi Hitesh
I have one question 1:24:45 at the moment you did not mention type for that parameters in createuser function,
you just provide the alias for parameter that's why it is not through any error. Please correct me if I am wrong.
So nicely explained. Thank you Sir🙏
Most welcome
You are a legend sir!!
2:14:41 Enum = Enumeration
1:43:22 my online TS compiler doesnt give me error for this operation, I was even able to console.log the value and got spiderman correctly, Is this some new update?
Thanks for the video sir.
Amazing video sir , Sir you have any Hindi channel for programming ...
Yes! We can push values in read only array. This is weird. What's the solution?
Sir g ❤🙂 love from Pakistan
my variableMe.js isnt showing the code it made on its ts file .how to fix it
Thank you sir....💯♥️
Complete Node js series caan u do sir
Excellent video can you please make video on react + typescript
Thanks Hitesh this would help a lot👍
such a nice video to learn ts
Best quality. Really helpful
a big thank you!
Quality of video is awesomeness 🔥
Thanks
Thanks a lot
Hi please what keyboard is that on your desk if i may ask, thanks ?
Could you please do a video for Cypress as well as GraphQL in Cypress?
Your Video is made me perfect...
please start a backend devlopement is typescript