【发布时间】:2010-12-07 16:59:54
【问题描述】:
如何在javascript中使用return
function hello1() {
function hello2() {
if (condition) {
return; // How can I exit from hello1 function not hello2 ?
}
}
}
【问题讨论】:
-
你的意思是退出 hello2 而不是 hello1
-
我想这取决于你如何调用 hello2,直到你从 hello1 返回一个对象,才能执行 hello2。我认为您将不得不发布一个更准确的示例来说明您要完成的工作,而不是一个伪问题。
标签: javascript function return