I have the following code in my project:

```
for(i = 0; i < inputArr.length; i++) {
    if(accountsBool) {
        inputArr[i] = inputArr[i].split(/\s+/);
        if (inputArr[i] == "" || !inputArr[i].match(/[^\s]/)) {
            inputArr.splice(i,1);
        }
    }
}

```

I'll try to explain the issue the best I can...

I need this portion of the code to remove all whitespace and empty strings, but the lines...

```
inputArr[i] = inputArr[i].split(/\s+/);

```

and...

```
if (inputArr[i] == "" || !inputArr[i].match(/[^\s]/)) {
    inputArr.splice(i,1);
}

```

...don't work together. I get the error, "Object doesn't support this property or method". If I comment out one and run the code with the other it seems to work fine. The syntax seems to be right too. Any ideas?

inputArr is an array of strings that is parsed in from a text area.

Thank you.