If I sort array I cant use map.
var arrQuestByDate = new Array();
action.payload.data.forEach(function(item){
if(typeof(arrQuestByDate[item.date])==='undefined'){
arrQuestByDate[item.date]= new Array();
}
arrQuestByDate[item.date].push(item);
console.log(arrQuestByDate[item.date].length) //this output good value
})
console.log(arrQuestByDate.length) //this output 0
I dont know why my array length is 0
arrQuestByDate[item.date]?arrQuestByDateshould be object. Please share input and expected output.