Learning the Art of DOM programming
function test(){
//if(!document.getElementById("xx")) return false;
if(variable == 1) return true;
}
console.log(test());
two if statements are in different functions. I understand the first sentence of
in order to make it easier for me to write them together. If the browser does not have this method (true inside the parentheses), exit the entire function.
see the second if today, why do you exit this function when you have true in parentheses? (page 176)
at the same time, if you print test () in the console, you get undefine.... Where on earth did this true go by return?
if there is no if, return directly in the function, you can get the value of return.
I am the younger brother, I am the younger brother, and please do not hesitate to comment.