Concise Body Arrow Functions
The ES6 version of javascript has a method to refactor the arrow function. The most concise method which is known as concise body.
Concise body functions which have zero to one arguments need to to be enclosed inside parentheses Example:
A function body which has just a single line of code block does not need any curly braces, whatever the line interperates will be returned automactically, the contents of the code block starts from the
=>
and thereturn
keyword can be removed which is referred as implicit return.
Example:
Last updated