JavaScript with Switch statements