Fetch - Week 09


Welcome to week 9 of Intro to Web Dev!

Now you know how to write your own JavaScript code. This week you’ll learn about the fetch() function, which let you fetch content from other URLs!

Work through the activities in this page to complete the week!


Fetch

First, watch this video and read through the tutorial to learn about the fetch() function:


APIs

Now that you’ve learned about the fetch() function, you can start using APIs!


Quiz

  1. In your own words, what is the fetch function?

  2. In your own words, what is a promise in JavaScript?

  3. In your own words, what is JSON?

  4. In your own words, what is an API?

  5. When working with promises, which is your favorite and why?

    • Callback functions
    • Anonymous functions
    • Arrow functions
    • Async and await

    Note: There isn’t really a wrong answer to this question, I just want you to think about the pros and cons and your own personal coding preferences.


Project

Now you’ve seen the fundamentals of the fetch() function and APIs.

To practice these concepts, modify the files in the week-09-fetch directory of your project repo.


Checklist

  1. Learn about the fetch() function and APIs
  2. Follow the directions in the week-09-fetch directory of your project repo
  3. Push those changes to GitHub and confirm you can see them in your GitHub Pages site
  4. Get ready to present your work. Make sure your camera and microphone work!