If/Else statement in JavaScript