REACT - ARROW FUNCTION

 Arrow Function
Syntax for using Arrow Function

// Normal Function
function Add(a,b) {
   return a +b
}

//Arrow Function
let AddWithAF = (a,b) =>{
    return a +b
}
OR
let AddWithAFInLine = (a,b) => a + b


// Normal Function
function IsPositive (number) {
return number >= 0
}
//Arrow Function
let isPositiveWithAF (number) => return number >= 0
OR
let isPositiveWithAFInLine number => return number >= 0


// Normal Function
function GenerateRandomNumber () {
return math.random
}
//Arrow Function
GenerateRandomNumberWithArrowFunc () =>  return math.random

Comments

Popular posts from this blog

Shared / Static Class in vb.net/C#

Xamarin Forms : PopUp Page with RG.Plugins.Popup

Text was truncated or one or more characters had no match in the target code page.". (SQL Server Import and Export Wizard)