What Purpose of Arrow Functions?

Tell us what’s happening:
I understand the concept especially that i used lambda expressions in java but the point is, what is it used for (speaking specifically about const myFunc = () => "value"; i mean you could make it an equality/assignment sentence or just an equation. why did they invent that () for?

Link to the challenge:

it’s just an example to show also the implicit return

usually there is more logic inside an arrow function than just returni a string, but it’s a simple way to show the syntax

1 Like

The () contain the arguments for the function. For example:

const add = (num1, num2) => num1 + num2;
add(10, 8);
//18
1 Like