A deep dive into optional chaining and the nullish coalescing operator

close-up of a heavy chain, with a body of water in the background

Of all the new features released as part of the ES2020 (aka ES11) specification, I have found optional chaining and the nullish coalescing operator to be the ones I find most useful. In this article, I will show you how they can benefit your projects.

Nullish Coalescing Operator

In JavaScript, undefined and null

Write better conditionals in JavaScript with object literals

Question mark next to a closed door

Writing complex conditionals in JavaScript has always had the potential to create some pretty messy code. Long lists of if/else statements or switch cases can get bloated quickly.

When there are multiple conditions, I find object literals to be the most readable way of structuring code. …

Know how useEffect works to avoid lint warnings and infinite loops

Question mark scribbled on paper

If you have ever worked with useEffect, you have probably come across the following lint warning:

React Hook useEffect has a missing dependency. Either include it or remove the dependency array.

Sometimes it’s as simple as just adding the required dependency, but often this results in some pretty unexpected behaviour…

A comparison of the three contenders in global state management

code on a computer screen

With the sands of global state management constantly shifting, it can be difficult to know which option to choose. Redux has for a long time been the library of choice, but with the Context API providing state management baked into React itself, many people have been declaring that Redux is…

Use ES6 object destructuring to make you code easier to understand

I recently found myself in a situation where I had to add an additional parameter to a function that is used in multiple places in the codebase. Because of the order of the parameters, adding another one at the end would mean passing unnecessary values when I needed to call…

Jack Taylor

I am a UI developer writing about JavaScript, React and tech in general. Sign up to my newsletter on my website: https://jacktaylor.co/

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store