Checking something isEmpty in Javascript?

If you’re testing for an empty string:

if(myVar === ''){ // do stuff };

If you’re checking for a variable that has been declared, but not defined:

if(myVar === null){ // do stuff };

If you’re checking for a variable that may not be defined:

if(myVar === undefined){ // do stuff };

If you’re checking both i.e, either variable is null or undefined:

if(myVar == null){ // do stuff };

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)