[Solved] How to sum an array value at specific index ranges [closed]
var words = [“Player “, “1”, “Player “, “2”, “Player “, “3”, “Position”, “In/Our”, “Position”, “In/Our”, “Position”, “In/Our”, “2”, “1”, “11”, “0”, “10”, “0”, “6”, “0”, “10”, “1”, “5”, “1”, “8”, “1”, “11”, “1”, “11”, “0”, “3”]; var index=0; var results = words.filter(word => {index= words.indexOf(word,index)+1;return ((index-1) % 6) == 0;}); console.log(results); Then you can … Read more