
// Fetching user data and images
function getUserData(userId) {
    
    fetch(`http://example.com/users/${userId}`)
        .then(response => response.json())
        .then(data => {
            document.getElementById('userName').innerText = data.name;
            document.getElementById('userEmail').innerText = data.email;
            
            fetch(`http://example.com/users/${userId}/image`)
                .then(response => response.blob())
                .then(imageBlob => {
                    const imageUrl = URL.createObjectURL(imageBlob);
                    document.getElementById('userImage').src = imageUrl;
                });
        });
}

getUserData(4578);
