ES6 - Use Arrow Functions to Write Concise Anonymous Functions

I dont understand this lesson. Why would someone write a function that has no body and just a value? Wouldn’t that just be a variable?

const myFunc = () => "value";

VERSUS

const myFunc = "value";

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:105.0) Gecko/20100101 Firefox/105.0

Challenge: ES6 - Use Arrow Functions to Write Concise Anonymous Functions

Link to the challenge:

1st line - A variabled named myFunc is assigned a function that returns the string “value”.

2nd line - A variable named myFunc is assigned the string “value”.

The function…

const myFunc = () => 'value';

…is functionally the same as this.

const myFunc = () => {
  return 'value';
};

The first has an implicit return and the second has an explicit return.