Momentum logo
Team 12 Classroom

Getting Data Using APIs with JS and Fetch

Posted on Apr 5th, 2022

Today’s topics

  • Today’s first goal is to complete the customer database.
  • The next task is to prepare to start working with fetch and AJAX tomorrow.
    • Using JSON for data
    • Basics of HTTP requests
    • Make GET requests with Insomnia client
    • Make GET requests using the Fetch API and display response data on a page

✅ Pre-work for before class tomorrow

🎯 Project: Choose Your Own Adventure

Your assignment is to do one of the following assignments. Whichever you choose, it will be due on Friday morning.

🔖 Resources

HTTP

APIs

AJAX, Fetch, & JSON

⭐ EXTRA/TMI

Fetch requests use JavaScript promises to handle responses. Promises are a much bigger topic than we will get into right now, but if you want to know more about what a promise is and how to use it beyond the context of AJAX requests, you can start with the MDN documentation about it.

🦉 Notes

JS Objects

Posted on Apr 4th, 2022

Today’s topics

  • Introduction to the object data structure in JavaScript
  • Storing data in and retrieving data from objects

🎯 Project: Build a customer directory

Link to assignment invitation For Tuesday Morning, 4/5: Start HTML and get at least one customer rendered on the page

Examples from class that will help you

🔖 Resources

⭐ EXTRA/TMI

🦉 Code, Notes & Videos

JavaScript and the DOM

Posted on Mar 31st, 2022

Today’s topics

  • Using JS in the browser
  • The DOM: the Document Object Model
  • DOM manipulation with JS
  • Events in JS

🎯 Project: JavaScript Calculator

This assignment is due Monday, April 4.

Link to the assignment invitation for part 1

If you complete part 1, continue to part 2. Continue in the same repository as part 1, nothing additional to clone. You can read the instructions for part 2 here.

🐈 Kittens and Puppies 🐶

  • Use the notes) and the example from class as a guide.
  • The video from morning class is also available, where we talk about DOM mapipulation. Passcode: .TJ4@Nw@

🔖 Resources to use as reference

⭐️ EXTRA/TMI

This resource is really not at all necessary to understand or do the project, but if you want to know more about the concept of tree structures in computer science, check out this piece from Vaidehi Joshi’s BaseCS blog series. She is awesome! There is also a thoroughly delightful accompanying BaseCS podcast with the equally amazing Saron Yitbarek.

And here is more info about what is happening when a browser renders a page – very enlightening, although not strictly necessary at this stage:

This is a good explanation about how JS events “bubble” up the chain of elements on the page:

If you would like to know more about the JavaScript Event Loop and how it works, I highly recommend this resource. Don’t miss the video of the conference talk that goes along with it – it’s excellent:

JavaScript Reps 🏋️‍♂️

Posted on Mar 30th, 2022

🗓️ Today’s topics

  • Review what we have seen so far in JS
  • Scope and arrow functions
  • Get your reps in! Practice and more practice

🎯 Project

More Loop Practice

Examples from morning class Code Academy Loops

👻 Exercism: JavaScript Track

To get some more practice writing JavaScript, we’re going to use an awesome free online tool called Exercism.

Please sign up (you can use your GitHub account) and choose the JavaScript track.

There are two ways to use Exercism: on their site with their online editor or by installng a command line tool and working on the exercises locally. It is much easier to use the online editor, so I recommend that you do that. However, you are welcome to work locally if you want to work through the setup (their documentation is excellent). Here is an overview summarizing the two options for solving exercises.

If your exercises are locked you need to switch from Learning Mode to Practice Mode. Here’s a short video showing you how to do that.

Complete at minimum the first three following exercises in the JavaScript track. For each exercise, make all the tests pass and follow the instructions on Exercism to submit your solution.

  1. Hello World (required)
  2. TwoFer (required)
  3. Raindrops (required)
  4. Hamming
  5. ResistorColor
  6. If you finish those, try any other learning exercise that looks interesting to you!

To submit your homework, paste your solution urls into this form.

⭐ EXTRA/TMI

🔖 Resources

  • MDN JS Guide
  • JS for Cats If you want a low-key walk through of basics that is full of 😺 😼 😹 🐈‍⬛ 🐈, this is pretty helpful. It’s older so you will see references to the var keyword instead of let or const.

🦉 Code & Notes