我无法传递所有论点。我的承诺回调只收到一个而不是三个:
var asyncFunction= function(resolve) {
setTimeout(function() {
resolve("Some string that is passed", "and another", "third");
}, 1000);
};
var promiseFunction = function () {
var deferred = Q.defer();
asyncFunction(deferred.resolve);
return deferred.promise;
};
promiseFunction().then(function() {
// Only one argument is passed here instead of 3
// { '0': 'Some string that is passed' }
console.log(arguments);
});
知道我做错了什么吗?