const points=games=>games.reduce((output,current)=>{ return output += current[0]>current[2] ? 3 : current[0]===current[2] ? 1 : 0; },0) //DIFERENTE ESCRITO: function points(games) { return games.reduce((output,current)=>{ let x = parseInt(current[0]); let y = parseInt(current[2]); let value= x>y ? 3 : x===y ? 1 : 0; return output+value; },0) }
Preview:
downloadDownload PNG
downloadDownload JPEG
downloadDownload SVG
Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!
Click to optimize width for Twitter