I have the following C# code that i need to convert to javascript:

```
    static private string[] ParseSemicolon(string fullString)
    {
        if (String.IsNullOrEmpty(fullString))
            return new string[] { };

        if (fullString.IndexOf(';') > -1)
        {
            return fullString.Split(new[] { ';' }, StringSplitOptions.RemoveEmptyEntries).Select(str => str.Trim()).ToArray();
        }
        else
        {
            return new[] { fullString.Trim() };
        }
    }

```

i see that javascript has a split() function as well but i wanted to see if there is built in support for the other checks or i have to do an additional loop around the array afterwards to "clean up" the data?