javascript if defined and not null