array[i].(split) is not a function

Solution 1:

I'm only guessing because you aren't showing the full content of the array, but I suspect you want something closer to:

array[i].year.split(" ")

Further, rather that split on the spaces, it would make more sense to split on the spaces and the dash together, using a regex that doesn't care about how many spaces (if any) are present:

array[i].year.split(/\s*-\s*/)

The above will return a single-element array when there is one year, a two-element array when a range of years is given.

One further step would be to convert the array to numbers instead of strings:

array[i].year.split(/\s*-\s*/).map(n => parseInt(n, 10))