To array objects questions duplicate removal . if id Same value , It's the same element .
The method of de duplication is as follows :
// duplicate removal let arr = [] for(let i = 0;i < questions.length;i++){ let j for(j = 0;j < arr.length;j++){ if(arr[j].id == questions[i].id){ break } } if(j == arr.length){ arr.push(questions[i]) } } questions = arr