Skip to content

Commit ee379c2

Browse files
add variable
1 parent ae440de commit ee379c2

File tree

7 files changed

+27
-0
lines changed

7 files changed

+27
-0
lines changed

ECMAScript/A01-Variable/bool.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let bool=true;

ECMAScript/A01-Variable/const.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
const constVariable=1;
2+
function constFunction(){
3+
const constVariableInFunction=2;
4+
console.log(constVariable);
5+
}
6+
constFunction();
7+
//console.log(constVariableInFunction);

ECMAScript/A01-Variable/let.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//在ES6及之后,变量是通过let关键字声明的
2+
let letVariable=1;
3+
function letFunction(){
4+
let letVariableInFunction=2;
5+
console.log(letVariable);
6+
}
7+
letFunction();
8+
console.log(letVariableInFunction);

ECMAScript/A01-Variable/null.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let variable=null;

ECMAScript/A01-Variable/number.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let number=1;

ECMAScript/A01-Variable/string.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
let string="hello";

ECMAScript/A01-Variable/var.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
//在ES6之前,变量是通过let关键字声明的
2+
var varVariable=1;
3+
function varFunction(){
4+
var varVariableInFunction=2;
5+
console.log(varVariable);
6+
}
7+
varFunction();
8+
//console.log(varVariableInFunction);

0 commit comments

Comments
 (0)