javascript if null then assign value