Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
docs: 变量名改为习惯用法
xxx这种名称偏向于口语化,适用于不严格的使用环境。 开发常用的约定俗称的随机名是 foo, bar, baz 等等
  • Loading branch information
waitingsong committed Oct 29, 2017
commit ea98bdafa534be48adfb95ea177929d474166740
4 changes: 2 additions & 2 deletions docs/module.md
Original file line number Diff line number Diff line change
Expand Up @@ -404,9 +404,9 @@ export {add as default};
// export default add;

// app.js
import { default as xxx } from 'modules';
import { default as foo } from 'modules';
// 等同于
// import xxx from 'modules';
// import foo from 'modules';
```

正是因为`export default`命令其实只是输出一个叫做`default`的变量,所以它后面不能跟变量声明语句。
Expand Down
2 changes: 1 addition & 1 deletion docs/proxy.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ let proto = new Proxy({}, {
});

let obj = Object.create(proto);
obj.xxx // "GET xxx"
obj.foo // "GET foo"
```

上面代码中,拦截操作定义在`Prototype`对象上面,所以如果读取`obj`对象继承的属性时,拦截会生效。
Expand Down