For example, I have such array: var number2 = [1,3,4,1,5,6,3]
and I want to output only repeated elements such as 1 and 3 without any method. My code is as follows:
for(let i=0; i<number2.length; i++){
for(let j=0; j<number2.length; j++){
if([i]!==[j] && number2[i]===number2[j]){
console.log(number2[i]);
}
}
}
But it doesn't work how I want.