fix: use arrow function syntax (#37818)
This commit is contained in:
committed by
Manish Giri
parent
0c22313760
commit
dc1b59070e
@ -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
|
||||
```
|
||||
|
Reference in New Issue
Block a user