return new Promise((resolve, reject) => {
      }).then((result) => {
      }).catch((err) => {
      });
      Javascript language logo

      Promise Complete with then and catch

      My JavaScript recipes

      The code creates a new Promise object and sets its then method to resolve, which will return the result of the code block, and its catch method to reject, which will throw an error if the code block fails.

      Shortcut: promise.full

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.