I am using following code snippet and I am pretty sure I am doing something that wrong that is why it is not returning more than one values. I need experts opinion on it.
function returnValues(testArray)
{
var accountId, orders, abstractOrders, titleOrder;
var childOrders = new Array();
for(var i = 0; i < testArray.length; i++)
{
accountId = typeof testArray[i] === 'undefined'?'':testArray[i].id;
orders = getOrderofParentAccount(accountId);
abstractOrders = abstractOrderYTD(orders);
titleOrder = titleOrderYTD(orders);
childOrders[abstractOrders,titleOrder];
}
return childOrders;
}
childOrders[abstractOrders,titleOrder];is not right at all. You can't use two indexes on a JS array.childOrders.push([abstractOrders, titleOrder])