javascript inline if then else