javascript switch case conditional statement