javascript check if null ternary