Hello Friends given an array:
var x = [1,9,2,1,5,6,2,9];
How could you identify the elements that are repeated in the array x and put those repeated in another array?
I know I have to go through it with for (i=0; i<x.length;i++)
and save it in another array with a push, but I would not know how to compare each element with all the elements of the array.
I appreciate suggestions. I'm a beginner in Javascript.
Thank you for your contributions