statement vs expression javascript code example
Example: expression vs statement javascript
An expression is any valid unit of code that resolves to a value.
An statement is any valid unit of code that resolves to an instruction.
Wherever JavaScript expects a statement, you can also write an expression.
The reverse does not hold.