I'm struggling with a switch case statement, which is evaluated as true. Nevertheless, the code for that case statement is not being executed. It's weird for me. Any help will be appreciated. Thanks in advance.
switch ([operation, state]) {
case [(Array((Number(state.result).toString() === [''])))
&& (Array((Number(state.secondNumber).toString() === ['']))) &&
state.mathOp === '' && operation === '-'] :
console.log([operation, state]);
setState((state) => ({
result: -Math.abs(Number(['-'])),
mathOp: operation,
secondNumber: [""],
}));
setUpdatedState(false);
setValue(0);
break;
default:
console.log(new Error('Unknown clickHandlerOp function error...'));
}