$chiubaca / notes / fleeting / 2021-02-10
  • 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 or undefined. use || to check for truthyness

Edit on GitHub ✏️

Hey I'm Alex Chiu 👋. These are my notes for literally anything.

I'm using the Zettelkasten method to organise my thoughts here.

My more polished writings are published to my main blog at chiubaca.com

Follow me on: Github / X (Twitter) / Mastodon / LinkedIn