I have read the documentation:
An expression statement is one that evaluates an expression and ignores its result. As a rule, an expression statement's purpose is to trigger the effects of evaluating its expression.
Is 'if' expression or expression statement?
What is the difference between expressions and expression statements?
the grammar says
ExpressionStatement :
ExpressionWithoutBlock ;
| ExpressionWithBlock ;
?
it just means that you aren't using any value that comes from the expression.
// this is an expression statement
// uncommenting the `let x` part would make `foo.bar()` a non-statement expression
/* let x = */ foo.bar();
1 Like
I saw examples in the documentation and my assumptions turned out to be correct, but I decided to check
So, it seems like if
is an expression than expression statement
system
Closed
August 1, 2024, 10:27pm
6
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.