diff --git a/JavaScript/a-allSettled.js b/JavaScript/a-allSettled.js new file mode 100644 index 0000000..261f6f6 --- /dev/null +++ b/JavaScript/a-allSettled.js @@ -0,0 +1,20 @@ +"use strict"; + +const fetch = require("./6-fetch.js"); + +const baseUrl = "http://localhost:3000"; + +const promises = [ + fetch(baseUrl + "/person"), + fetch(baseUrl + "/"), + fetch(baseUrl + "/fail"), + fetch(baseUrl + "/city"), +]; + +Promise.allSettled(promises) + .then((values) => { + console.log(values); + }) + .catch((err) => { + console.log(err); + }); diff --git a/JavaScript/a-thenable.js b/JavaScript/b-thenable.js similarity index 100% rename from JavaScript/a-thenable.js rename to JavaScript/b-thenable.js diff --git a/JavaScript/b-expirable.js b/JavaScript/c-expirable.js similarity index 100% rename from JavaScript/b-expirable.js rename to JavaScript/c-expirable.js