Simple adding operation and a variable inside an array

Hi,
This seems like a javascript question; I need to add a numerical value from a variable contained in an array.

Book01 [9] -- the number is stored here

I try to add to variable CurrentIncome += Book01[9]

The result? CurrentIncome=0.

Is this because it has converted into a string, or maybe turned CurrentIncome variable into an array? BTW, the Book01[9] array has numbers in it, I made sure.

See image for what I'm doing. Thank you!
Generally there is nothing wrong with drawing numbers from an array, so there is nothing particular wrong in your screenshot.

However, variables are indeed set to 0 instead of throwing an error when the selected arithmetic operation fails (probably to catch division by zero).
If you are not sure about the types of your values, you can use
typeof $gameVariables.value(31)
to get the exact type of a variables content (should usually be "number").
It might be also worth printing out what you are adding to rule out that the result could actually be correct of course.

Not sure if it helps here, but you can find the implementation of that event command in "js/rpg_objects.js" line 9408ff. within your project folder (you can search the file for "Control Variables").

Original thread: https://forums.rpgmakerweb.com/threads/simple-adding-operation-and-a-variable-inside-an-array.115304/