JavaScript Fetch API


The Fetch API helps web browsers ask web servers for information through HTTP requests.

😀 You don't have to use XMLHttpRequest anymore.


A Fetch API Example

The code snippet provided retrieves a file and shows its contents.

Because Fetch relies on async and await, the example provided might be simpler to comprehend in this manner:

Or, it's even better to use clear names instead of 'x' and 'y'.