Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JavaScript promises MDN

try {
  const result = syncDoSomething();
  const newResult = syncDoSomethingElse(result);
  const finalResult = syncDoThirdThing(newResult);
  console.log(`Got the final result: ${finalResult}`);
} catch(error) {
  failureCallback(error);
}
Source by developer.mozilla.org #
 
PREVIOUS NEXT
Tagged: #JavaScript #promises #MDN
ADD COMMENT
Topic
Name
5+4 =