I am returning an array from a function in JavaScript and I need to be able to know when it contains nothing but a single empty string. When I print that value to the console, it returns this:
[""]
I get an error if I do the following:
if(myVar == [""]){
// do something
}
How can I test for that value in that variable? jQuery answers are perfectly acceptable as well as plain JavaScript.
myVar == [""]. What's the error?