Blog

Exclusively required method parameters with TypeScript

Exclusively required method parameters with TypeScript

Using Typescript to denote required and optional method parameters is simple. However, sometimes that isn't enough - what tools does TypeScript provide allow for implementing mutually exclusive parameters?

Objects as parameters in JavaScript

Objects as parameters in JavaScript

Despite JavaScript being one of the hottest programming languages of the day, it lacks some key functionality supported by many modern languages. This said, the JavaScript trump card is flexibility, which can be exploited to mimic unsupported features. Use JS objects to fake the named argument feature seen in many other languages.

Copyright © 2021-2022 Michael Ward