From 9a13212e2f58c8152bf31ef55ce8bf447e7bdc3a Mon Sep 17 00:00:00 2001 From: Adrian Chira Date: Mon, 26 Nov 2018 08:00:59 +0200 Subject: [PATCH] Changed var to const (#22486) Changed var to const to resemble the English version of the file --- .../chinese/javascript/falsy-values/index.md | 24 +++++++++---------- 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/guide/chinese/javascript/falsy-values/index.md b/guide/chinese/javascript/falsy-values/index.md index dce37bfe43..cba89adf61 100644 --- a/guide/chinese/javascript/falsy-values/index.md +++ b/guide/chinese/javascript/falsy-values/index.md @@ -19,17 +19,17 @@ if (!variable) { ## 一般例子 ```javascript -var string = ""; // <-- falsy - - var filledString = "some string in here"; // <-- truthy - - var zero = 0; // <-- falsy - - var numberGreaterThanZero // <-- truthy - - var emptyArray = []; // <-- truthy, we'll explore more about this next - - var emptyObject = {}; // <-- truthy +const string = ""; // <-- falsy + +const filledString = "some string in here"; // <-- truthy + +const zero = 0; // <-- falsy + +let numberGreaterThanZero; // <-- falsy + +const emptyArray = []; // <-- truthy, we'll explore more about this next + +const emptyObject = {}; // <-- truthy ``` ## 有阵列的乐趣 @@ -71,4 +71,4 @@ const match = { teamA: 0, teamB: 1 } * [Falsy |词汇表| MDN](https://developer.mozilla.org/en-US/docs/Glossary/Falsy) -* [Truthy和Falsy:当JavaScript中的所有不相等时](https://www.sitepoint.com/javascript-truthy-falsy/) \ No newline at end of file +* [Truthy和Falsy:当JavaScript中的所有不相等时](https://www.sitepoint.com/javascript-truthy-falsy/)