javascript assign value if not null