> For the complete documentation index, see [llms.txt](https://hemantajax-2.gitbook.io/es6-step-by-step/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hemantajax-2.gitbook.io/es6-step-by-step/arrow-function.md).

# Arrow Function

```javascript
// ES5
function greet(name){
    console.log("Hello! "+ name);
}
greet("Hemant");

// ES6
var greet = (name) => console.log("Hello! "+ name);
greet("Hemant");

// for single method parameter we can ommit () see below
// OR ( as returned value)
var greet = name => "Hello! "+ name;
console.log(greet("Hemant"));
```
