Description
This guide is a bit special in the way that when you review this guide you will do the review in person (in the classroom or through a video call on Slack)
The modern browsers offer loads of Web APIs (Application Programming Interfaces) for the developers to use, but some are more commonly used than others.
This guide is all about exploring the endless possibilities that JavaScript (and hence also TypeScript) has to offer. JavaScript has a few built in APIs that you can use and that you have already used like the DOM API and the forms API. Here is a complete overview of all built-in APIs that JavaScript has to offer.
You can use this guide to dive deeper into web development (in a practical way) or have a bit fun with TypeScript.
💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻 The practical: 💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻💻
The most commonly used APIs by web developers are these:
- DOM - working with HTML elements in the TypeScript
- Forms - checking validity of inputs and helping users fill out the correct information
- Fetch - Getting data from external resources (this is what Module 4 is all about)
- Storage - saving data in the browser so that it stays there even if a user refreshes the page
- History - going back or forward (like using the back and forward buttons of the browser)
Use the DOM and Form APIs if you want to get a deeper understanding of what we have already been doing in this module.
Use the Fetch API if you want to prepare for what is coming in the next module.
Use the Storage or History APIs if you want to see what is available.
🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️ The Fun: 🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️🕹️
If you want to have a bit of fun (that is often the best way to learn something) here are a few APIs that could be nice to play around with:
- Canvas - A nice and fun way of creating graphics with JavaScript, you can make games, animations or anything you can think of
- Web Audio - A fun API to play sounds on a website, you can for example create a digital piano or other instruments
- Media Capture and Media Stream - Here you can get the video from the users camera and play with that
You can even go a bit out of your comfort zone and use third party libraries (even though that will be strictly forbidden in the final project for this module). Doing that will practice the important skill of reading documentation but you will be doing a lot of that as a web developer. Such 3rd party libraries are for example:
- Phaser.io - a game engine to create computer games in JavaScript
- p5 - a library to create fun animations
- Greensock - a library to create micro-animations for websites
- aframe.io - a library to create VR with JavaScript