[size=medium]If a function executes a return statement with no expression , or if it returns because it reaches the end
of the function body, the value of the function-call expression is undefined .
Because of JavaScript's automatic semicolon insertion, you may not include a line break between the
return keyword and the expression that follows it.[/size]
of the function body, the value of the function-call expression is undefined .
Because of JavaScript's automatic semicolon insertion, you may not include a line break between the
return keyword and the expression that follows it.[/size]
本文详细解析了JavaScript中函数执行return语句时的行为,特别是不带表达式的return语句及函数体结束时的情况。此外还介绍了JavaScript中的自动分号插入特性,并强调了return关键字后不应插入换行。

被折叠的 条评论
为什么被折叠?



