Unity Adding to an Int from an Array

I’m trying to access a number from an array and use it to add to a variable. However, when i try :

public var minerals : int;
public var masterProf = new Array ();
     minerals = (masterProf *+ minerals);*

it says that I cannot combine an int and an object. How should I fix this?

You’re using an Array that is not strongly typed, you need to specify what the output from that index in that Array type is, otherwise it will return Object(also don’t use Array types, use List/Collection/standard array of X-type)

minerals = ((int)masterProf*) + minerals;*

or use an array of ints instead for minerals then you don’t have to worry since it’s strongly typed.
public var minerals : int;
public var masterProf : int[];
minerals = masterProf + minerals;

I actually in the last few minutes just managed to find a solution that worked, but I really do appreciate the help anyway @Landern. If anyone happens to stumble across this question later, I found that lists were the most useful for what I needed. I’d never really seen lists before, but they work nicely once you put in the time to figure them out.
https://unity3d.com/learn/tutorials/modules/intermediate/scripting/lists-and-dictionaries
I know the tutorial is in C#, but the examples below cover it all in Javascript, and lists are actually almost identical for both with a few differences in how you declare them, but that’s just the differences inherent to the two languages.
Thank you again