ECMAScript6 allows programmers to write programs in an asynchronous style, in order to achieve higher performance through concurrency. Such features as the async/await
syntax mean that asynchronous functions can be written in a natural way that reads similar to straight-line code. The function can be suspended midway through execution until a result arrives that allows it to continue.
Here is an example which shows how you can use this syntax to implement a function that suspends in the middle of execution until it has received a response to the HTTP request we sent.
const fetch = require("node-fetch");
async function getJson(url) {
try {