# Review Algorithmic Thinking by Building a Dice Game - Step 7

### Tell us what’s happening:

I get “Uncaught TypeError: arr.reduce is not a function” in the console and I’m not sure how else to write that the arr param is an array of numbers. I am also unsure why this code doesn’t pass and what I’m missing.

``````<!-- file: index.html -->

``````
``````/* file: script.js */
// User Editable Region

const getHighestDuplicates = (arr) => {

function sum(arr){
arr.reduce((a, b) => a + b, 0)
}

arr += arr.sort((a, b) =>  a - b)

for (let i = 0; arr.length > i; i++){
if (arr[i] === arr[i++] === arr[i+2] !== arr[i+3] || arr[i] !== arr[i++] === arr[i+2] === arr[i+3] !== arr[i+4] || arr[i++] !== arr[i+2] === arr[i+3] === arr[i+4]){

}
else if (arr[i] === arr[i++] === arr[i+2] === arr[i+3] || arr[i++] === arr[i+2] === arr[i+3] === arr[i+4]){
}
else if (arr[i] === arr[i++] !== arr[i+2] !== arr[i+3]){
}

}}
rollDice()
console.log(getHighestDuplicates(diceValuesArr))

if (rolls === 3) {
} else {
rolls++;
rollDice();
getHighestDuplicates(diceValuesArr)
}
});

// User Editable Region
``````
``````/* file: styles.css */

``````

User Agent is: `Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/128.0.0.0 Safari/537.36`