Let's say I have a function like this:
checkerFunction() {
let checker = false;
// Note here I only do a return if the *if* condition is fulfilled
if (condition) {
checker = true;
return checker;
}
}
And then I use it as a true/false check on another function:
anotherFunction() {
// What will happen here if there's no return from this.checkerFunction()
if (this.checkerFunction()) {
somethingHappens;
}
}
What will happen in
if (this.checkerFunction())
if there's no return in checkerFunction() because the condition was never true... Is it going to be interpreted as true/false or is this going to be an error and why?