if (valid === null) {
return '';
} else if (!valid) {
return 'is-not-valid';
} else if (valid) {
return 'is-valid';
} else {
return '';
}
I have the above if-else-if chain in the code, trying to see if I can write the same logic in one or two lines.
elsestatement will never be hit so you can remove that already.!!validorBoolean(valid)? developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…