angularjs - Javascript If condition to check a variable with empty object or not -


i have variable var = {};

if ( !==null) { // entering here if var has empty object don't want enter. }  if (a == null) { // want enter condition if var has empty object. } 

i have tried several ways write condition giving a=={} still entering first condition. please let me know appropriate way check condition?

first option

var = null; 

second option

if ( !==null && json.stringify(a) !== '{}') {..} 

Comments

Popular posts from this blog

sql server - Cannot query correctly (MSSQL - PHP - JSON) -

php - trouble displaying mysqli database results in correct order -

C++ Linked List -