Hey! querySelectorAll is def a solid choice for how to find array of properties by data attribute javascript.
But if you wanna filter, just chain it with `filter()`:
```javascript
const elements = [...document.querySelectorAll('[data-role]')].filter(el => el.dataset.role === 'admin');
```
Also, check out MDN’s docs on dataset—super helpful for this stuff!
But if you wanna filter, just chain it with `filter()`:
```javascript
const elements = [...document.querySelectorAll('[data-role]')].filter(el => el.dataset.role === 'admin');
```
Also, check out MDN’s docs on dataset—super helpful for this stuff!
