Why doesn\'t a.push(b) work in my Array.reduce()? a=a.push(b) where b is a string, turns a to an integer.?!
a.push(b)
Array.reduce()? a=a.push(b)
b
a
The push() returns the new length. You can use ES2015 spread syntax:
var winner = objKeys.reduce((a, b)=> { a = (frequency[b] === highestVal)? [...a, b] : a; return a }, []);