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
Post a Comment