任何人都可以告诉我,在编程中什么是“return false”或“return true”,尤其是在JavaScript或PHP中[关闭]

who can help me with this problem I don't understand " return true " or "false" in programing. especially this keyword " return "

false and true are bool values and can use in return from functions. for example bellow if i is a even number func1() return true and it's meaning that i is even and else func1() return false and it's meaning that i is a ODD number:

function func1(i)
{
if (i%2==0)
    return true;
 else return false;
}

return is generally a keyword in programing language. It is used to return back the result of a function to any variable or any other function that calls that function.

function a (num) {
 if (num < 1) {
  return ;
 }
 else {
  document.write("The number is" + num + "<br />);
 }
}
a(0);
document.write("I like numbers greater than 0");

In this case, the number sent to the function is 0, so the function returns to the code after the function call, and will write the text "I like numbers greater than 0". If the number were instead 1, then the text "The number is 1" would be written first, and the text "I like numbers greater than 0" would be written below it.