check if not null and not undefined javascript