The purpose of this class is to introduce to the student:
- How to use the
fetchAPI to do AJAX calls - The structure and use of
Promises - The
thiskeyword and its relationship withscope
FIRST HALF (12.00 - 13.30)
- 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
- How to use the
fetchAPI 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)
- The
thiskeyword and its relationship withscope
Notes: