A beginners guide to Typescript | Collective Literal Types, Widening and Narrowing Types

  Рет қаралды 6,991

developedbyed

developedbyed

Күн бұрын

Пікірлер: 13
@developedbyed
@developedbyed 8 ай бұрын
Hope you enjoy this series, leave anything you want me to discuss that's typescript related here, so I can talk about them in the next episode 👍 Fullstack course is halfway filmed as well, it's gonna be huge
@TiriasCZ
@TiriasCZ 8 ай бұрын
8:15 So are we supposed to use only instanceof instead of typeof or are there any cases where we should use typeof?
@developedbyed
@developedbyed 8 ай бұрын
Hope this makes it clear typeof expression is the operator that lets you determine the type of expression. typeof evaluates to one of the values: 'string', 'number', 'boolean', 'symbol', 'undefined', 'object', 'function'. typeof null evaluates to 'object', thus the correct way to use typeof to detect an object is typeof object === 'object' && object !== null. instanceof operator let's identify the instance's constructor. object instanceof Constructor evaluates to true if object is an instance of Constructor.
@developedbyed
@developedbyed 8 ай бұрын
Usually use typeof for primitives, cause when you pass it an object, array, null or ehatever it will just give you back “object” Whereas with instanceof you can check if you pass an array for ex unction isArray(value) { return value instanceof Array; } isArray([1, 2, 3]); // => true isArray({ prop: 'Val' }); // => false
@IOSALive
@IOSALive 8 ай бұрын
developedbyed, This video is fantastic! I liked it a lot!
@developedbyed
@developedbyed 8 ай бұрын
Thank you very much!
@billynasir3146
@billynasir3146 8 ай бұрын
I would like to buy your Next JS course but is it getting updated?
@developedbyed
@developedbyed 8 ай бұрын
Update out in about 2 weeks!
@tevfik7
@tevfik7 8 ай бұрын
Why all my fave youtube devs use tsx for react courses? Jsx pls, I barely learned js and now everything is in ts 😂🤦🏻‍♂️
@encilaj1444
@encilaj1444 8 ай бұрын
Sheesshhh.
@johnlayda3299
@johnlayda3299 8 ай бұрын
Shesh
@belike_fury
@belike_fury 8 ай бұрын
Firstttttttt
@developedbyed
@developedbyed 8 ай бұрын
you are first and managed to edit your comment, gg
Avoid These Typescript Mistakes
9:31
developedbyed
Рет қаралды 10 М.
Жездуха 41-серия
36:26
Million Show
Рет қаралды 5 МЛН
A beginners guide to Typescript | Why use it?
10:39
developedbyed
Рет қаралды 20 М.
Don't Make These 10 SQL Mistakes
18:53
developedbyed
Рет қаралды 7 М.
8 TypeScript Tips To Expand Your Mind (and improve your code)
10:54
Learn Typescript with React | Quick Crash Course
16:59
developedbyed
Рет қаралды 101 М.
How Did I Not Know This TypeScript Trick Earlier??!
9:11
Josh tried coding
Рет қаралды 218 М.
I Redesigned the ENTIRE YouTube UI from Scratch
19:10
Juxtopposed
Рет қаралды 840 М.
This Terminal Will Give You Superpowers
15:43
developedbyed
Рет қаралды 9 М.
5 Tips and Tricks To Make Your Life With Next js 14 Easier
17:11
developedbyed
Рет қаралды 44 М.
Why use Type and not Interface in TypeScript
14:12
ByteGrad
Рет қаралды 218 М.