Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

Simplest Promise Example

let hw = await new Promise((resolve)=>{
resolve(“HELLO WORLD”);

})

console.log(hw);
 
/*basically in resolve(whatever') the whatever is returned*/
/*hw will console.log out "HELLO WORLD" */
Source by zellwk.com #
 
PREVIOUS NEXT
Tagged: #Simplest #Promise #Example
ADD COMMENT
Topic
Name
4+5 =