DEV Community

loading...

Discussion on: Unpacking arrays with destructuring

Collapse
richardeschloss profile image
Richard Schloss

I thought the hipster way to capitalize was something like this:

const capitalize = (str) => str.replace(/[a-z]/, (val) => val ? val.toUpperCase() : val)

:)