arguments arrow function code example
Example 1: arrow function in javascript
function PrintName(name){
console.log("my name is ", name) ;
}
const PrintName = (name) => {
return console.log("my name is " , name) ;
}
Example 2: Arrow Functions
const magic = function() {
return new Date();
};
const magic = () => {
return new Date();
};
const magic = () => new Date();
Example 3: arrow function
function (a){
return a + 100;
}
(a) => {
return a + 100;
}
(a) => a + 100;
a => a + 100;
Example 4: 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
Example 5: arrow function
Killing deer, wounding cowboys, getting to the right place, moving up a line