js arrow anonymous function

Solutions on MaxInterview for js arrow anonymous function by the best coders in the world

showing results for - "js arrow anonymous function"
Kilian
01 Nov 2020
1let show = function () {
2    console.log('Anonymous function');
3};
4//… can be shortened using the following arrow function:
5let show = () => console.log('Anonymous function');
6
7//Similarly, the following anonymous function:
8let add = function (a, b) {
9    return a + b;
10};
11
12//is equivalent to the following arrow function:
13let add = (a, b)  => a + b;