If and Else statement in JavaScript - 3m physics

If and Else statement in JavaScript