Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [ [ RowDataPacket { id: 1, text: 'один-два дня', id_question: 1, answer: 1 },
- RowDataPacket { id: 2, text: 'более 5 дней', id_question: 1, answer: 0 },
- RowDataPacket { id: 3, text: '3-5 дней', id_question: 1, answer: 0 } ],
- [ RowDataPacket { id: 4, text: 'да', id_question: 2, answer: 1 },
- RowDataPacket { id: 5, text: 'нет', id_question: 2, answer: 0 },
- RowDataPacket {
- id: 6,
- text: 'не постоянно, Меняется постоянно',
- id_question: 2,
- answer: 0 } ],
- [ RowDataPacket { id: 7, text: 'да', id_question: 4, answer: 0 },
- RowDataPacket { id: 8, text: 'нет', id_question: 4, answer: 0 },
- RowDataPacket { id: 9, text: 'не помню', id_question: 4, answer: 1 } ] ]
- for(i=0; i < answearArr.length; i++){
- let arr = answearArr[i];
- console.log(arr.find({answer: 0}))
- }
- TypeError: # is not a function
- console.log(arr.find(function(item){ return item.answer == 1; }));
- console.log(questions.map(function(question){ return question.find(
- function(answer){ return answer.answer == 1; }
- )}));
Add Comment
Please, Sign In to add comment