Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

js arrow anonymous function

let show = function () {
    console.log('Anonymous function');
};
//… can be shortened using the following arrow function:
let show = () => console.log('Anonymous function');

//Similarly, the following anonymous function:
let add = function (a, b) {
    return a + b;
};

//is equivalent to the following arrow function:
let add = (a, b)  => a + b;   
Source by www.javascripttutorial.net #
 
PREVIOUS NEXT
Tagged: #js #arrow #anonymous #function
ADD COMMENT
Topic
Name
6+9 =