Exam 03: Preparation

This exam will be on paper, and must be taken in-person on the last day of regular classes.

Learning Objectives

Asynchronous Programming

  • Declare and determine the values of variables based on scope (lexical vs. global) specifically in the context of asynchronous tasks
    • Use both let and const as appropriate
    • Understand why var is not advised for variable declaration
  • Pass a callback function as an argument to another function using either a function name, anonymous function, or arrow function
    • Example: doSomething(x => x.length);
    • Example: doSomething(theThingToDo);
  • async
    • Create and use functions that return a Promise
      • Example: function foo() { return new Promise(resolve => resolve(...); }
    • Create and use functions declared as asynchronous
      • Example: async function foo() { ... }
    • Use fetch to retrieve data from a JSON file for processing
      • Example:
        fetch(data).then(resp => resp.json()).then(x => console.log(x));
        
      • Example:
        const resp = await fetch(data);
        const parsed = await resp.json();
        console.log(parsed);
        

Data Persistence and Exchange

  • store information in/retrieve information from the URL (e.g. via the query string)
  • export/import
    • store information (such as the application’s state, e.g. from localStorage) in a file (e.g. a JSON file)
    • read information (such as the application’s state) from a file (e.g. a JSON file) and make use of it (e.g. persist it to localStorage)

Study Resources

The exam primarily focuses on the most recent content. Specifically the asynchronous programming and data persistence and exchange as outlined above.

Preps

Labs

Textbook Reading

Consider reviewing these sections from the past few weeks:

  • 5.6 Styling and Designing Forms

  • 5.7 Validating User Input

  • 9.5 Forms in JavaScript

  • 10.3 Asynchronous Coding with Javascript

  • 10.4 Using Browser APIs

  • 10.5 Using External APIs

  • MDN localStorage

  • MDN FileReader

Our website’s additional resource

For example, some may find @mpj’s promises video linked there to be helpful

Last modified November 20, 2025: Simplify E3 Q2-3 solution (c3e4183)