¡@

Home 

javascript Programming Glossary: addasync

how to use q.js promises to work with multiple asynchronous operations

http://stackoverflow.com/questions/13597909/how-to-use-q-js-promises-to-work-with-multiple-asynchronous-operations

task has been completed. Here's a simpler example function addAsync a b var deferred Q.defer Wait 2 seconds and then add a b setTimeout.. function deferred.resolve a b 2000 return deferred.promise addAsync 3 4 .then function result console.log result logs 7 after 2.. result console.log result logs 7 after 2 seconds The addAsync function adds two numbers but it waits 2 seconds before adding..