[1] [()] the operation + cannot accept the argument
Why this is not working?
You should define indexOfValue variable to a number.
This variable:
Should be defined to a number ( exactly as you made with the index variable) as you are adding numbers to it, you can’t add a number to list

you can only add numbers to a number.