我试图修改一个数组,在其中包含其他数组,我得到超出最大调用堆栈大小,并且不知道为什么。
app.selected.forEach(function(customer) {
app.dateInterval.forEach(function(dateint) {
customer[+dateint] = []
app.eventsEmail.forEach(function(event) {
var date = event.Data;
date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
date = date.setDate(date.getDate() + 1);
if (event.IdCustomer == customer.IdCustomer && (+date) == (+dataint))
customer[+dateint].push(event);
});
});
});
有人知道如何解决这个问题吗?
答案 0 :(得分:0)
var size = app.selected.length;
for(i=0;i<size;i++){
var customer = app.selected[i];
app.dateInterval.forEach(function(dateint) {
customer[+dateint] = []
app.eventsEmail.forEach(function(event) {
var date = event.Data;
date = new Date(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0);
date = date.setDate(date.getDate() + 1);
if (event.IdCustomer == customer.IdCustomer && (+date) == (+dataint))
customer[+dateint].push(event);
});
});
});
}