Arrow Functions

An arrow function expression has a shorter syntax than a function expression and does not have its own this, arguments, super, or new.target.

Javascript

//Normal Functions
var myfunction = function(a){
	return a;
}
myfunction(5)

//Arrow Functions
var myfunction = (a) => {
	return a +2;
}

//Arrow Functions Example 2
var myfunction = a => {
	return a + 2;
}
//Arrow Functions Example 3
var myfunction = a => a +2;

//Arrow Functions Example 4
var myfunction = () => 2 +2;
	
//Arrow Functions Example 4
var myfunction = (a, b) => a +b;
Try Your Self

Copyright 2016 by WebiBeris.com. All Rights Reserved.