javascript assign if not undefined