C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,918 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Maybe solve it in this manner:
case { device: Touchscreen }:
case { device: Mouse }:
var a = x.device;
. . .
or
case { device: Mouse or Touchscreen }:
var a = x.device;
. . .
where x is the object that is currently analysed.
Probably it depends on other details.