In this course, I learned the principal structures of JS to work with asyncronism: call backs, promises and sync and await, and doing some challenges with APIs.
JavaScript is a syncronism langueaje, it executes its on a first-come, first-served basis. JavaScript has event loop, it takes care of visualizing all the input and output processes.
It's a function that receives another function as a parameter, to execite a process asynchronously.
In the first challenge, I make a request to an API, using xmlhttp.
It's a JavaScript object designed by Microsoft, to make requests to web servers.
We can install this dependency through npm with the following command: npm install xmlhttprequest
With this, we can use all the xmlhttp methods and successfully make our requests.
It uses the promise object to be executed now, later or never.
It makes our code behave synchronously.