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
@TiriasCZ8 ай бұрын
8:15 So are we supposed to use only instanceof instead of typeof or are there any cases where we should use typeof?
@developedbyed8 ай бұрын
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.
@developedbyed8 ай бұрын
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
@IOSALive8 ай бұрын
developedbyed, This video is fantastic! I liked it a lot!
@developedbyed8 ай бұрын
Thank you very much!
@billynasir31468 ай бұрын
I would like to buy your Next JS course but is it getting updated?
@developedbyed8 ай бұрын
Update out in about 2 weeks!
@tevfik78 ай бұрын
Why all my fave youtube devs use tsx for react courses? Jsx pls, I barely learned js and now everything is in ts 😂🤦🏻♂️
@encilaj14448 ай бұрын
Sheesshhh.
@johnlayda32998 ай бұрын
Shesh
@belike_fury8 ай бұрын
Firstttttttt
@developedbyed8 ай бұрын
you are first and managed to edit your comment, gg