Recording becomes easier when we record in bite-size chunks. It can be helpful to record with large pauses, so we can think about what we're going to say for the next chunk. This also helps splice together the good pieces when we start editing.
We can record audio and video separately or at the same time. Let's view an example.
First, let's type const URL and we'll set that equal to a string template. First, let's type const URL and let's set that equal to the GitHub API, so that's API.GitHub.com/users. Then we need some sort of user here that we can pass to this path.
Let's type const user equals some GitHub user name, which, if we use mine, that's Trevor D. Miller. Now we can use the global fetch function by saying fetch and then passing it our URL.
This function will return a promise, so we can say .then. When this promise resolves, it will contain our response. We'll say response and inside of this function, we can say response.JSON to convert our response into JSON.
Now we can say .then, and we can use our JSON response. Let's type .then. We'll have our JSON data, so we can do something with that. Let's console log out the type of the GitHub account.
We see we have the type of user, because the Trevor D. Miller GitHub account is of type user. If we go back up to our user string here and use Facebook, and we look at our browser, we now see that Facebook is of type organization.
Let's go down and type .catch. This will be used if we get an error, so we will get our error, and we can use that error, so let's just log out the error in this case.
Let's check that in our browser. Right now we're not getting an error. Let me turn off my network connection.
Now we get this type error failed to fetch.