Created
February 8, 2026 14:01
-
-
Save vanaf1979/15dbc573ae41ff15085e613de2ce71d0 to your computer and use it in GitHub Desktop.
Fetch filtering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const getActiveUsers = async () => { | |
| try { | |
| const response = await fetch('https://api.since1979.dev/users'); | |
| if (!response.ok) throw new Error('Network response was not ok'); | |
| const users = await response.json(); | |
| // Now we use our Array Methods to process the data! | |
| // Let's find only the developers from the API response | |
| const developers = users.filter(user => user.role === 'developer'); | |
| console.log('Filtered Developers:', developers); | |
| } catch (error) { | |
| console.error('Error in data pipeline:', error); | |
| } | |
| }; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment