() => () is the same but without the explicit return statement:
() => (something)
These are not the same.
This is a block of statements.
{ return something; }
This is an expression
(something)
They are very different things.
An expression evaluates to a value.
A block executes statements and does not evaluate to a value.
One of the statements in the block may be a return statement which causes the call to the function to evaluate to the returned value.
Differentiating clearly between statements and expressions will make your life easier.
While that is wrong, you can do this.
() => (return(
))
Unless you rewrite that return out or rewrite it to be in a block of statements, you cannot do this.
and
These are not the same.
This is a block of statements.
This is an expression
They are very different things.
An expression evaluates to a value.
A block executes statements and does not evaluate to a value.
One of the statements in the block may be a return statement which causes the call to the function to evaluate to the returned value.
Differentiating clearly between statements and expressions will make your life easier.
Unless you rewrite that return out or rewrite it to be in a block of statements, you cannot do this.
Thank you for this. I may need to have another glance at your examples for me to fully comprehend it!