Skip to main content

Posts

Showing posts with the label Arrow

Java Script Arrow Function ( ES 6 )

  Hey Guys, in this blog we are going to learn about What is Java Script Arrow Functions and how we can use it. Let's get started... - Arrow function has been introduced in the ES 6. - Arrow function allow us to write function shortly and simply. Arrow function looks like below const funcName = (arg1, arg2, arg3, ..., argN) => expression - Basically above expression means is it creates a  function  with  name: funcName  with the  arg1, arg2, ar3,...,argN  and after that, it's evaluate the  expression  and  return the results . - Let's take a simple example let's print the sum of two number using arrow function. In this example as you can see here function name is  sums  and it's take  two arguments x and y   and it's evaluate  expression ( x+ y )  and based on evaluation it will return result so here it will return  result 25. - Suppose if in any example if we have only  one parameter  so in that case we can  omitted parentheses  from pa