From 3d75c6a5fba0ece1ac8d37872ba9d39685abd2f0 Mon Sep 17 00:00:00 2001 From: "blue.xiaofeng" Date: Wed, 29 Sep 2021 08:53:25 +0000 Subject: [PATCH] update en/contribute/OpenHarmony-JavaScript-coding-style-guide.md. Signed-off-by: blue.xiaofeng --- en/contribute/OpenHarmony-JavaScript-coding-style-guide.md | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md b/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md index 2bc5234ca6..f540122b83 100755 --- a/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md +++ b/en/contribute/OpenHarmony-JavaScript-coding-style-guide.md @@ -353,9 +353,8 @@ console.log(url); //url can be accessed, output: http://127.0.0.1:8080 **Example:** ```javascript -// ES5.1 Using var to declare variables function open() { - var url = 'http://127.0.0.1:8080'; + let url = 'http://127.0.0.1:8080'; // todo something } open(); @@ -363,7 +362,6 @@ console.log(url); //Report: Uncaught ReferenceError: url is not defined ``` ```javascript -// In ES6, the let and const keywords are preferred to declare variables. function open() { const url = 'http://127.0.0.1:8080'; //todo something -- GitLab