From 187ccf11c9b6e9093e19ade5b634b7be30c70a4a Mon Sep 17 00:00:00 2001 From: Victor Lin Date: Mon, 22 Oct 2018 10:46:12 -0700 Subject: [PATCH] Added new comments to return Added new comments to return --- guide/chinese/javascript/return-statements/index.md | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/guide/chinese/javascript/return-statements/index.md b/guide/chinese/javascript/return-statements/index.md index f0a22575f3..5bbe3f2feb 100644 --- a/guide/chinese/javascript/return-statements/index.md +++ b/guide/chinese/javascript/return-statements/index.md @@ -33,6 +33,15 @@ function foo() { boo(); --> 1 ``` +建議還是在同一行返回內容,而不使用新行返回,以免發生未定義的狀況。 + +若不打算返回任何內容,也可以寫: + +``` +return ; +``` + + ## 例子 以下函数返回其参数**x**的平方,其中**x**是数字。 @@ -83,4 +92,4 @@ function foo() { [MDN链接](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/return) -[MSDN链接](https://msdn.microsoft.com/en-us/library/22a685h9.aspx) \ No newline at end of file +[MSDN链接](https://msdn.microsoft.com/en-us/library/22a685h9.aspx)