javascript check if object exists and not empty