<sectionid="description"> Si tiene muchas opciones para elegir, use una instrucción de <code>switch</code> . Una instrucción de <code>switch</code> prueba un valor y puede tener muchas declaraciones de <code>case</code> que definen varios valores posibles. Las declaraciones se ejecutan desde el primer valor de <code>case</code> coincidente hasta que se encuentra una <code>break</code> . Aquí hay un ejemplo de <dfn>pseudocódigo</dfn> : <blockquote> interruptor (núm) { <br> valor de caso1: <br> sentencia1; <br> descanso; <br> valor de caso2: <br> declaración2; <br> descanso; <br> ... <br> valor de casoN: <br> declaración N; <br> descanso; <br> } </blockquote><code>case</code> valores de <code>case</code> se prueban con igualdad estricta ( <code>===</code> ). La <code>break</code> le dice a JavaScript que deje de ejecutar sentencias. Si se omite la <code>break</code> , se ejecutará la siguiente instrucción. </section>
<sectionid="instructions"> Escriba una instrucción de conmutación que pruebe <code>val</code> y establezca la <code>answer</code> para las siguientes condiciones: <br><code>1</code> - "alfa"<br><code>2</code> - "beta"<br><code>3</code> - "gamma"<br><code>4</code> - "delta"</section>