// Prompt: Create a function to fetch user data from an API and filter by active status.
async function fetchActiveUsers() {
try {
const response = await fetch('https://api.example.com/users');
const data = await response.json();
const activeUsers = data.filter(user => user.isActive === true);
return activeUsers;
} catch (error) {
console.error('Error fetching users:', error);
}
}
Support for over 25+ programming languages and frameworks.