arraow function code example
Example 1: javascript arrow function
const welcome = () => {
console.log("THIS IS A ARROW FUNCTION")
}
Example 2: concise body arrow functions javascript
const plantNeedsWater = day => day === 'Wednesday' ? true : false;
Example 3: arrow function
Arrow Function is another way to write a function.
"classic method":
function x ()
{
console.log("X")
}
"arrow method":
var x= ()=>
{
console.log("X")
}
if we need to add paramiter is pritty simple:
var x = (PARAMS) =>
{
console.log(PARAMS)
}
Have a nice day