Answers for "js arrow anonymous function"

0

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;
Posted by: Guest on August-13-2021

Code answers related to "Javascript"

Browse Popular Code Answers by Language