function findOdd(A) {
var distinctElements = [...new Set(A)];
distinctElements.forEach(x => {
var count = A.filter(y => y === x).length;
if (count % 2 != 0) {
return x;
}
});
}
I don't understand why program is still executing after return statement.