Javascript – How to create a constructor without repeating yourself?
Consider the following TypeScript classes: class A { foo: string; constructor({ foo }: { foo: string }) { this.foo = foo; } equals(other: A) { return this.foo === other.foo; } } class B extends A { bar: number; constructor(b: {…