Toggling checkboxes based on certain conditions
I may have misunderstood something but if you just want to be able to detect case where the input string is none of expected, you may do something like that:

default:
  console.log("This operation '"+operation+"' is not supported, it will be ignored");


at the end of your switch\case construction