javascript check if variable is not null and not undefined