News for hackers. Stuff that matters.
Re:Statements vs. Expressions by jesperlang on Thursday July 14, 2022 @07:12AM (#32094410)
I find it better to actually look at the AST for javascript.

These are expressions:

https://github.com/estree/estree/blob/master/es5.md#expressi...

These are statements:

https://github.com/estree/estree/blob/master/es5.md#statemen...

I guess the confusing part for many is how an expression can also be a statement. But if you look at the ExpressionStatement you see that an expression is NOT also a statement. It's just the wrapper statement that makes it look so!

There are no comments on this comment yet.