What I like about this as opposed to what we had before is that the `/([A-Z])/g` and the `'-$1'` are side by side, so it's clear what the `$1` refers to.

We actually don't need a capturing group:

```javascript
return str.replace(/[A-Z]/g, '-$&').toLowerCase();
```