ES6 基础
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
(function test() {
|
||||
console.log(typeof value); // 引用错误
|
||||
let value = "blue";
|
||||
console.log(typeof value); // ReferenceError: value is not defined
|
||||
let value = "blue"; // 下面的语句都不会被输出
|
||||
console.log(value);
|
||||
})();
|
||||
|
@ -1,9 +0,0 @@
|
||||
let list = [];
|
||||
for (let i = 0; i < 10; i++) {
|
||||
list.push(function () {
|
||||
console.log(i);
|
||||
});
|
||||
}
|
||||
list.forEach(function (func) {
|
||||
func();
|
||||
});
|
||||
|
8
code/ES6/src/01_block_bindings/07_const.js
Normal file
8
code/ES6/src/01_block_bindings/07_const.js
Normal file
@ -0,0 +1,8 @@
|
||||
const author = {
|
||||
name: "heibai",
|
||||
};
|
||||
author.name = "ying";
|
||||
console.log(author);
|
||||
author = {
|
||||
name: "heibaiying"
|
||||
};
|
Reference in New Issue
Block a user