The typeof value === 'number' case does no validate that the response is either a string or number, so a null value will convert the value to 0 and do the comparison with this value.
I think the condition to enter this block would be to make sure response is number or string and ignore any other type.
The
typeof value === 'number'case does no validate that the response is either a string or number, so a null value will convert the value to 0 and do the comparison with this value.I think the condition to enter this block would be to make sure response is number or string and ignore any other type.