But you need to clarify how this is being triggered.
Usually the incoming message contains the things to be compared.
Changing a property defines if it is 1 or 2.
decs2 seems to get the values.
But how that works is way above my head.
Google, or your favourite search engine, is often the easiest way to get answers to such questions. Then look for the w3schools or MDN link there if there is one.