Accumulator of Array.reduce() returns change whenever i change ternary opertor’s return value
I am quite confused on how .reduce() work. Why is it that when I use accu.length for the ternary operator, it returns ‘foobar’, but when I use accu only, it returns ‘123456’. I am experimenting with .reduce, the code that I wrote is for experimenting.