javascript 有没有php中的exit()函数呢?
是完全中断程序;
return false;不适合用;
因为
function sample_one()
{
return false;
}
function sample_two()
{
sample_one()
alert(1);
}
sample_two();
执行结果:
alert(1)可以正常执行;
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
sample_one 中的return只是针对自身的函数
亦可
return false仅表达返回值是false,并无其他释义。但想达成你的要求也不难,利用短路求值就行,代码这么改:return false只是代表
sample_one()的值等于false。你可以
关键是php中你这样写也不行。