how to use switch in JavaScript