提交 3d75c6a5 编写于 作者: B blue.xiaofeng 提交者: Gitee

update en/contribute/OpenHarmony-JavaScript-coding-style-guide.md.

Signed-off-by: Nblue.xiaofeng <blue.xiaofeng@huawei.com>
上级 46f2246d
...@@ -353,9 +353,8 @@ console.log(url); //url can be accessed, output: http://127.0.0.1:8080 ...@@ -353,9 +353,8 @@ console.log(url); //url can be accessed, output: http://127.0.0.1:8080
**Example:** **Example:**
```javascript ```javascript
// ES5.1 Using var to declare variables
function open() { function open() {
var url = 'http://127.0.0.1:8080'; let url = 'http://127.0.0.1:8080';
// todo something // todo something
} }
open(); open();
...@@ -363,7 +362,6 @@ console.log(url); //Report: Uncaught ReferenceError: url is not defined ...@@ -363,7 +362,6 @@ console.log(url); //Report: Uncaught ReferenceError: url is not defined
``` ```
```javascript ```javascript
// In ES6, the let and const keywords are preferred to declare variables.
function open() { function open() {
const url = 'http://127.0.0.1:8080'; const url = 'http://127.0.0.1:8080';
//todo something //todo something
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册