edit docs/object

This commit is contained in:
ruanyf
2014-05-23 22:41:49 +08:00
2 changed files with 5 additions and 5 deletions
+4 -4
View File
@@ -11,7 +11,7 @@ ES6新增了let命令,用来声明变量。它的用法类似于var,但是
var b = 1;
}
a // ReferenceError: a is not defined.
a // ReferenceError: a is not defined.
b //1
```
@@ -102,10 +102,10 @@ function f1() {
```javascript
// IIFE写法
(function () {
(function () {
var tmp = ...;
...
}());
}());
// 块级作用域写法
{
@@ -115,7 +115,7 @@ function f1() {
```
另外,ES6也规定,函数的作用域其所在的块级作用域。
另外,ES6也规定,函数本身的作用域,在其所在的块级作用域之内
```javascript
+1 -1
View File
@@ -36,7 +36,7 @@ target // {a:1, b:2, c:3}
var target = { a: 1, b: 1 };
var source1 = { b: 2 };
var source1 = { b: 2, c: 2 };
var source2 = { c: 3 };
Object.assign(target, source1, source2);