same as if_else_js.html but adjusted to switch statements