fix: use arrow function syntax (#37818)

This commit is contained in:
Randell Dawson
2019-11-23 23:37:11 -08:00
committed by Manish Giri
parent 0c22313760
commit dc1b59070e

View File

@ -11,9 +11,8 @@ In order to help us create more flexible functions, ES6 introduces <dfn>default
Check out this code:
```js
function greeting(name = "Anonymous") {
return "Hello " + name;
}
const greeting = (name = "Anonymous") => "Hello " + name;
console.log(greeting("John")); // Hello John
console.log(greeting()); // Hello Anonymous
```