Quote
Im used to java where class objects are drastically easier to implement.
I'm not sure it's true that these things are drastically easier in Java. It might even be easier in JS in some ways.
However, the approaches taken by the two languages are (arguably) drastically different, which could certainly be an obstacle when coming from Java. JS uses an object-and-prototype based system, which in turn can be used to effect something like the 'classes' you're used to in Java (newer versions of JS include some syntactic sugar for this). It can take some getting used to though.
I'll add a couple comments in addition to what markypooch said.
First I'll mention that recent versions of JS include a number of new features, such as let and const as additions to (and arguably in most cases replacements for) var. If you're interested in best practices with respect to JS, you might look into references on ES6. (There are different terms for the different versions of JS, but the term 'ES6' should yield plenty of search results.)
Following on what markypooch said, you'll definitely want to embrace objects and (pseudo)classes if you're going to use JS. Once you get comfortable with what he described, you'll probably want to look into prototypes as an alternate (and sometimes preferred) way of sharing functionality between objects (this is where things start to look a little more like 'classes' from other languages). The newest versions of JS include some syntactic sugar that makes creating 'classes' at least as straightforward as it is in Java (in my view at least).
Once some of these pieces are in place, I think it'll start to become more obvious how to solve problems like the one you're asking about.
Lastly, one side note: you don't need the calls to parseInt() in your code, as the array elements are already numbers.