Пример promise

let promise = new Promise((resolve, reject) => {
  setTimeout(()=> resolve(x = 10), 2000);
});

 promise.then( x => { 
   console.log(x);
   x++;
   return x
  })
  .then(y => {
    console.log(y);
    y++;
    return y;
   })
   .then(z => {
    console.log(z);
   });