javascript check if property is not null or undefined