You are viewing a single comment's thread. Return to all comments →
Same logic but with reduce and in JS:
function gamingArray(arr) { let m = 0 return (arr.reduce((c,v) => v>m ? (m=v, c+1) : c, 0)) % 2 ? 'BOB' : 'ANDY' }
Seems like cookies are disabled on this browser, please enable them to open this website
Gaming Array 1
You are viewing a single comment's thread. Return to all comments →
Same logic but with reduce and in JS: