given an array find the int that appears an odd number of times. javascript code example
Example 1: sum of odd numbers in an array javascript without loop
var total = numbers.reduce(function(total, current) {
return total + current;
}, 0);
console.log(total);
Example 2: check if number appears odd number of times in array javascript
function findOdd(A) {
let counts = A.reduce((p, n) => (p[n] = ++p[n] || 1, p), {});
return +Object.keys(counts).find(k => counts[k] % 2) || undefined;
}