for (var key in entity)
{
if(task.find(item => item.ufCrmTask[0] == entity[key].ID)){
arrayList[entity[key].TITLE ? entity[key].TITLE : entity[key].NAME]
= task.filter(item => item.ufCrmTask[0] == entity[key].ID);
}else if(task.find(item => item.ufCrmTask === false)){
arrayList.withoutEntity = task.filter(item => item.ufCrmTask === false);
}
}
entity
, task
, arrayList
?3.2. Формулировать вопрос максимально информативно и однозначно.
9:
action: {accept: false, decline: false, complete: true, approve: false, disapprove: false, …}
favorite: "N"
id: "18"
title: "Задача без привязки к сущности"
ufCrmTask: false
__proto__: Object
10:
action: {accept: false, decline: false, complete: true, approve: false, disapprove: false, …}
favorite: "N"
id: "20"
title: "Задача для компании"
ufCrmTask: Array(1)
0: "CO_186"
5:
ID: "L_780"
TITLE: "Лид #780"
6:
ID: "CO_186"
TITLE: "AutoCompany90"
arrayList.withoutEntity =
6:
id: "20"
title: "Задача для компании"
ufCrmTask: ["CO_186"]
{
titleEntity:{
titleTask: title,
id: 2,
ufCrmTask: [D_2]
}
}
{
withoutEntity:{
titleTask: title,
id: 4,
ufCrmTask: [D_4]
}
}
var item
[{…}]0: {ID: "9270", TASK_ID: "18", }
(76) [{…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}, {…}]0:
(5) [{…}, {…}, {…}, {…}, {…}]0: {ID: "96", TASK_ID: "3",
[{…}]
[{…}]
[{…}]0: {ID: "9268", TASK_ID: "16",
{
title: 'task1'
comments: [{...}, {...}]
}
for
или forEach
, например.task.comments.forEach(function(comment){
// код
})