javascript check if object is not null or undefined