मुझे सभी तर्कों को पार करने में समस्या हो रही है। मेरा वादा कॉलबैक केवल तीन के बजाय प्राप्त करता है:जावास्क्रिप्ट वादा सभी तर्कों को पार नहीं कर रहा है (क्यू का उपयोग करके)
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);
});
कोई विचार क्या मैं गलत कर रहा हूं?
मेरा पैसा प्रकार के दबाव पर है –