@Tomek already has an excellent answer but I would still like to chime in here. One of your main problems is that you're mixing data types in your array, you shouldn't be doing that. If your array should contain strings and strings ONLY you can easily check it like this
if(typeof array[0] === "string" && array[0] !== "")
which would be a javascript equivalent of for example C#'s !string.IsNullOrEmpty.
Having multiple data types in the array complicates the checking and is indicative of an error in structuring your code. What happens for example if you enter null into the array? Then Tomek's test will fail. Of course, you could also do another check for null but I'd say it would be better to restructure your data model.
"undefined"as a string rather than testing against the valueundefined. But you should be checking againsttypeof(array[0])instead. So, what @Tomek said.[]and[undefined]?typeof variablenottypeof(variable)as "typeof" is an operator not a function (I'm sure it was typo, but still, for later generations and so on ;)