create `var currentDigit = ch - 0x30; // '0';` before the if and use it in next three clauses