The conversation between human and AI assistant.
What are Promises in Javascript?
That makes sense. Can a Promise be resolved with another Promise?
Yes, a Promise can be resolved with another Promise. This is known as Promise chaining. Here's an example:

```
const fetchUserData = () => {
    return new Promise((resolve, reject) => {
        fetch('https://jsonplaceholder.typicode.com/users/1')
            .then(response => response.json())
            .then(user => {
                return new Promise((resolve, reject) => {
                    fetch('https://jsonplaceholder.typicode.com/posts?userId=' + user.id)
                        .then(response => response.json())
                        .then(posts => {
                            user.posts = posts;
                            resolve(user);
                        })
                        .catch(error => {
                            reject(error);
                        });
                });
            })
            .then(user => {
                console.log(user);
            })
            .catch(error => {
                console.log(error);
            });
    });
}

fetchUserData();
```

In this example, we make a call to an endpoint to get a user, and then chain another Promise to it that fetches all posts by that user. Once both Promises are fulfilled, we add the posts to the user object and log it to the console.