What do you want to save?
Add Code snippet
New code examples
-
Javascript 2021-09-27 23:12:05
promise.all map statement
//Here i have filmresponse.json() which will return promise so i uses promise. //all otherwise it won't be possible to run it let characterResponse = await fetch('http://swapi.co/api/people/2/') let characterResponseJson = await characterResponse.json()... Add solution -
TypeScript 2021-09-21 17:38:03
typescript get promise allsettled
/* To get this running on Linux, I needed the latest typescript version: */ npm install -g typescript@latest /* Then in your tsconfig you currently need the ES2020.Promise lib. */ { "compilerOptions": { "lib": [ "ES... Add solution -
Javascript 2021-09-06 13:05:03
how to create multiple folders at once in node js
'use strict'; const { mkdir } = require('fs').promises; (async function main() { try { const parent = '.'; const dirnames = ['pdfs', 'fonts', 'err/or', 'users']; await Promise.all( dirnames.map(dirname => mkdir(`${parent}/${dirn... Add solution