This seems so super strange.
I have the following
$.when.apply(null, arrayOfDeferredObjects).then(function(result)) {
if (1 == arrayOfDeferredObjects.length){
//stuff done here
}
else{
for (var index = 0; index < contentUnits.length; index++) {
if(arguments && arguments[index][0] && arguments[index][0].response) {
//stuff done here
}
};
}
My expectation is that arguments will be an array of 1 object for 1 call in the array of Deferreds and an array of X objects for X calls in the deferred array.
I know why this is happening but it frustrates me to do that check for the length of the array. Arguments isn't an array when there is only 1 object and is where there is more than 1. That's obvious. Is there anything I can do to make the parameter returned not just represent the first call?