JavaScript is one of those languages where you can build a lot without knowing every feature. But as I continue building projects, I've come across a few features that make my code cleaner and easier to maintain.

Here are five JavaScript features I wish I had learned much earlier.

1. Optional Chaining (?.)

Accessing nested properties used to look like this:

const city = user && user.address && user.address.city;