Skip to main content
-1 votes
2 answers
93 views

In section then3 I want to generate promises with further operations on their content inside 2 "thens". In case they were fetches, I want to limit their start to for example 3 at once every ...
Pirous's user avatar
  • 17
1 vote
1 answer
27 views

people. I have a Angular application which I am integrating with a node.js server. It works like this: A service is injected in the component The component calls the getAccountData() function from ...
Felipe Benévolo's user avatar
0 votes
0 answers
28 views

I'm trying to dynamically call external JS files. I'm using promise to wait for file to be loaded and then execute the code. How ever I don't want to run all the code inside positive promise. I'd like ...
Orbit's user avatar
  • 31
4 votes
2 answers
93 views

I am learning microtask queue and i have a simple question. With the following code: Promise.resolve().then(()=>console.log("Resolved1 Promise")); Promise.reject().then(()=>console.log("...
Muhammad Hamza Maqsood's user avatar
0 votes
1 answer
81 views

const p1 = new Promise((_, reject) => { reject(1); }).then((r)=>console.log(r)).catch((r)=>console.log(r)); const p2 = new Promise((resolve, _) => { resolve(10); }).then((r)=>...
bored_coffee's user avatar
0 votes
2 answers
92 views

I am learning promise chaining and I stumbled upon a doubt. Consider the below promise chain - const myPromise = new Promise((resolve, reject) => { setTimeout(() => { resolve("...
Arman Lalani's user avatar
-1 votes
1 answer
114 views

Consider a scenario where I have two tasks - Task 1 is a callback which is set to be executed after 1 sec using setTimeout. Task 2 is a synchronous/blocking task which takes comparatively more time ...
Arman Lalani's user avatar
2 votes
1 answer
55 views

I am struggling a bit with asynchronous operations and Promises (a quite new concept to me) using FileReader. I have found a very interesting thread about it there, but can't make my script to work ...
feub's user avatar
  • 589
0 votes
0 answers
30 views

I am quite new to Javascript, with my main programming experience in assembly language programming of micro-controllers. It has taken quite some time to adjust to it having so many 'system calls', (to ...
SaK's user avatar
  • 23
-2 votes
2 answers
408 views

Consider the following assignments: const promise1 = (async () => { await someAsyncFunction(); })(); const promise2 = new Promise(async resolve => { await someAsyncFunction(); ...
OpenAI was the last straw's user avatar
2 votes
1 answer
84 views

Recently I've been given a following problem: console.log("start"); const promise1 = Promise.resolve().then(() => { console.log("promise1"); const timer2 = setTimeout(() => { ...
Roma Kim's user avatar
  • 371
1 vote
1 answer
67 views

This is the code: function SSD() { console.log('SSD') } async function createData() { let status = undefined try { const res = await fetch('https://api.github.com/users/Soumya-...
SOUMYA SANKAR DAS's user avatar
1 vote
0 answers
891 views

My case - "form data to be auto saved before navigating to new page". Firefox is cancelling form post with "NS_BINDING_ABORTED" and navigating to new page. Body - onbeforeunload is ...
Uma Sankar's user avatar
2 votes
1 answer
89 views

This is an interesting observation that I have made when experimenting with promises in JS. Consider this code: Promise.resolve(1).then(2).then(console.log); This prints out 1 as its output. ...
Napoleon Bonaparte's user avatar
2 votes
1 answer
191 views

I was recently watching a workshop video by Will Sentence on async javascript and I am having trouble understanding whether microtask queue always has priority over macrotask queue. function display(...
S Y's user avatar
  • 31

15 30 50 per page
1
2 3 4 5
12