javascript check if object is empty or null or undefined