This is one of the smarter aspects of using TS, good explanation. Some small side note, at 4:40 in real life we probably should use (unless it's on purpose) Object.hasOwn() instead of in, because the latter also finds the properties through the prototype chain.
@SoftwareDeveloperDiaries Жыл бұрын
Great point!
@fusion.chronicles6 ай бұрын
The best explanation so far 👍
@rajsatraroxor96037 ай бұрын
In last example, while changing from fruit instanceof to isTasty in, last keyword "Banana" should be changed to parameter "fruit", to check isTasty exisits or not in fruit which is passed into that function
@jvsvogler2 жыл бұрын
Really helpful, thanks a ton!
@SoftwareDeveloperDiaries2 жыл бұрын
Glad it helped!
@SalimOfShadowАй бұрын
In the 4th example, wouldn't the comparison always return false if the two args's content are even slightly different? I think the type is what matters the less at that point since we're comparing it by content