I would like to use a function to check if a condition is true. And I saw this illustration in somewhere:
function check_condition() {
if( first_condition ) {
return false;
}
return true;
}
What I don't understand is that even if the first condition returns false, the function eventually still returns true because the condition inside the function is above the return true?
returnbreaks out of the function. Nothing after is evaluated.