Exam 03: Preparation
This exam will be on paper, and must be taken in-person on the last day of regular classes.
Categories:
2 minute read
Learning Objectives
The learning objectives are statements of what you should be able to do at this point in the course. If you are unsure about any of these topics, use the resources below to review and practice further.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);
- Example:
- async
- Create and use functions that return a Promise
- Example:
function foo() { return new Promise(resolve => resolve(...); }
- Example:
- Create and use functions declared as asynchronous
- Example:
async function foo() { ... }
- Example:
- 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);
- Example:
- Create and use functions that return a Promise
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. aJSONfile) - read information (such as the application’s state) from a file (e.g. a
JSONfile) and make use of it (e.g. persist it tolocalStorage)
- store information (such as the application’s state, e.g. from
Study Resources
The exam primarily focuses on the most recent content. Specifically the asynchronous programming and data persistence and exchange as outlined above.
Preps
- Prep 08: 10.1, 10.4.1, and localStorage
- Prep 09: Events and Asynchronicity - 9.3.3-9.4, 10.3
- Prep 10: Location interface, URL API, and the File API’s Blobs
Labs
- 10-card-creator
- 11-card-viewer
- 12-them-problem
- 13-http-req
- 14-play-fetch
- 15-localStorage
- 16-file-download-read
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
Our website’s additional resource
For example, some may find @mpj’s promises video linked there to be helpful