javascript ternary operator if not null