ES6 基础

This commit is contained in:
罗祥
2019-12-15 19:03:36 +08:00
parent f0f3336641
commit 0b506230fe
24 changed files with 1858 additions and 11 deletions

View File

@ -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);
})();

View File

@ -1,9 +0,0 @@
let list = [];
for (let i = 0; i < 10; i++) {
list.push(function () {
console.log(i);
});
}
list.forEach(function (func) {
func();
});

View File

@ -0,0 +1,8 @@
const author = {
name: "heibai",
};
author.name = "ying";
console.log(author);
author = {
name: "heibaiying"
};