Skip to content

Latest commit

 

History

History
42 lines (25 loc) · 911 Bytes

File metadata and controls

42 lines (25 loc) · 911 Bytes

Lesson Plan JavaScript3 Week 2

Agenda

The purpose of this class is to introduce to the student:

  • How to use the fetch API to do AJAX calls
  • The structure and use of Promises
  • The this keyword and its relationship with scope

Core concepts

FIRST HALF (12.00 - 13.30)

  1. The structure and use of Promises

Notes:

  • It's the accepted solution to callback hell
  • It's a way to introduce asynchronicity to your application
  • Makes asynchronous code read like it's synchronous

Show examples

  1. How to use the fetch API to do AJAX calls

Notes:

  • Modern replacement of XMLHttpRequest
  • Uses Promise structure
  • The Fetch API is defined in the browser
  • Only modern browsers support it (show caniuse.com)

Do exercise

SECOND HALF (14.00 - 16.00)

  1. The this keyword and its relationship with scope

Notes: