-
More Fullstack React, TS & Node
-
Abstract classes used when you just want to specify the signation of method in a class. This allows for other classes which extend off it to implment their own versions of the methods, this is also known as overriding.
-
Interfaces are another way to provide to write a contract for your code. They contain no implemtation details.
-
Generics allow for your type definitions to include an associated type chosen by the user. Usually used when the exact type is unknown but will be used in various places like an argument.
-
optional chaining is useful for handling unknown object properties so that they are returned as null or undefined
-
nullish coalescing is a new shortcut for the ternary operator
val1 ?? val2; // return val1 if it is not null or undefined, otherwise return val2
nullish coalescing is checking specfically for
null
orundefined
. use||
to check for truthyness
-