
Arrow Functions in JavaScript: A Simpler Way to Write Functions
In this article we will discuss about different way of declaring function, how you use and declare them? and the major difference between them. By the end of the article you will understand more about the Regular and Arrow function in JavaScript. What arrow functions are Arrow function is the consice way of writing function in javascript. It give ability so you can skip the boilerplate code which you write every time in function declaration before ES6. Arrow function support more features like lexical this binding, implicit return, more predictability than normal function. Every normal function declaration required boilderplate setup code like function keyword, {} curly braces, and return keyword. function greet ( name ){ return `Hello! Good Morning ${ name } ` } But with arrow function it become optional it can be skipped. It only needed in some cases. const greet = name => `Hello! Good Morning ${ name } ` Basic arrow function syntax Any basic arrow function requried three things for
Continue reading on Dev.to Webdev
Opens in a new tab


