I have added an else statement to cover the case of noMatch.
This way we can cover all the cases as well as we can refractor some code from the above lines.
Now the logic for obtaining the response is pretty straight forward, it looks like:
if(exactMatch or partialMatch is found) {
we have perfect response for it
} else {
we have some default `noMatch` response
}
I have added an else statement to cover the case of noMatch. This way we can cover all the cases as well as we can refractor some code from the above lines. Now the logic for obtaining the
response
is pretty straight forward, it looks like: