@heyrohit/promises-1
Nodejs

No description

fork
loading
repl talk
(games)
Files
  • index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
function getPromise() {
  const taskPromise = new Promise((resolve, reject) => {
    console.log("task started.");
    
    setTimeout(() => {
      console.log("done after 100ms.");
      resolve();
    }, 100);
  });
  
  return taskPromise;
}

getPromise();
node v9.7.1 linux/amd64