How to filter an array?

Hello. How to get a new array with elements not found in the array used? https://jsfiddle.net/optq7rrs/
June 10th 19 at 14:23
2 answers
June 10th 19 at 14:25
Solution
elements.filter(n => !used.some(m => m.id === n.id))
June 10th 19 at 14:27
indexOf + while???)))

Find more questions by tags JavaScript