I am having trouble passing all arguments. My promise callback only receives one instead of three:
var asyncFunction= function(resolve) {
setTimeout(func
If you want to pass along multiple values, you must wrap them in another single value that you pass, such as an array or an object.
Q promises can be resolve
d with only one argument - a promise stands for one single value, not for a collection of them. Put them in an array explicitly if you need multiple values. For the multiple-parameter-callbacks, you can use .spread().
Synchronous functions return only one value, same way asynchronous should resolve with one.
It's a bad practice to create async functions that resolve with many values. If you want to pass many values, return them in array or dict object, same as you would do if given function would be synchronous.