mirror of
https://github.com/ruanyf/es6tutorial.git
synced 2024-04-21 12:32:22 +00:00
edit let & function & string
This commit is contained in:
+5
-5
@@ -45,7 +45,7 @@ function log(x, y = 'World') {
|
||||
|
||||
log('Hello') // Hello World
|
||||
log('Hello', 'China') // Hello China
|
||||
log('Hello', '') // Hello
|
||||
log('Hello', '') // Hello
|
||||
|
||||
```
|
||||
|
||||
@@ -58,7 +58,7 @@ function Point(x = 0, y = 0) {
|
||||
this.y = y;
|
||||
}
|
||||
|
||||
var p = new Point();
|
||||
var p = new Point();
|
||||
// p = { x:0, y:0 }
|
||||
|
||||
```
|
||||
@@ -70,7 +70,7 @@ var p = new Point();
|
||||
```javascript
|
||||
|
||||
fetch(url, { body='', method='GET', headers={} }){
|
||||
console.log(method);
|
||||
console.log(method);
|
||||
}
|
||||
|
||||
```
|
||||
@@ -107,8 +107,8 @@ function f(x, y=5, z) {
|
||||
|
||||
```javascript
|
||||
|
||||
function foo(x=5, y=6){
|
||||
console.log(x,y);
|
||||
function foo(x=5, y=6){
|
||||
console.log(x,y);
|
||||
}
|
||||
|
||||
foo(undefined, null)
|
||||
|
||||
Reference in New Issue
Block a user