DEV Community

Discussion on: What are your fav ES6 features?

Collapse
 
bendman profile image
Ben Duncan • Edited

I find async/await greatly simplifies asynchronous flows.

Like others have said, I use destructuring, rest, spread, import/export, arrow functions, const/let, and template literals every day and don't even consider them to be new features at this point. Default params are also quite nice.

Most of my programming for work is functional, but I use extends and classes for personal projects when I'm working on agent-based scientific modeling or genetic algorithms, as I tend to use object-oriented programming for those.

Emergency edit:

The optional chaining operator is great, and pairs well with the nullish coalescing operator!

const foo = { bar: "hi" };

foo.bar?.toUpperCase() ?? "not available"; // "HI"
foo.buzz?.toUpperCase() ?? "not available"; // "not available"