In JavaScript, you can define object properties on the fly with Object.defineProperty. This is useful if you want your properties to be read-only or similar. Think of a storage object that has a maximum value that shouldn’t be overwritten:| fettblog.eu
TypeScript’s control flow analysis lets you narrow down from a broader type to a more narrow type:| fettblog.eu