Short notes about anything that catches my attention. Also a place to save stuff I keep forgetting over and over.
08/01/2026
18:49
type Shape = Circle | Square;
function getArea(shape: Shape) {
switch (shape.kind) {
case "circle":
return Math.PI * shape.radius ** 2;
case "square":
return shape.sideLength ** 2;
default: {
const exhaustiveCheck: never = shape;
return exhaustiveCheck;
}
}
}
This is a hand-crafted, a little weird personal website. Create one of your own!