jquery - Test for array containing a single empty string in JavaScript -
jquery - Test for array containing a single empty string in JavaScript -
i returning array function in javascript , need able know when contains nil single empty string. when print value console, returns this:
[""]
i error if following:
if(myvar == [""]){ // }
how can test value in variable? jquery answers acceptable plain javascript.
i use:
if( myvar instanceof array && myvar.length === 1 && myvar[0] === '' ) { // .... }
javascript jquery arrays json comparison
Comments
Post a Comment