
Expressions and statements are the bread and butter of a program’s code structure. In this blog I try to explain the concept of expressions and statements.
Expressions are fragments of code that produces a new value as a result. For example it is similar to arithmetical operation. By arithmetical operations we can do addition or subtraction between two numbers or more to create a new number as the result. There is an easy way to spot expressions is to look for the operator sign in the code.
There are different types of expressions:
- Arithmetic Expressions :

Expressions that evaluate to a number
- String Expressions:

Expressions that evaluate to a string
- Array and Object Expressions:
These expressions return array or object data type
- Logical Expressions :
These expressions return Boolean data type
- Object Creation Expressions:These expressions return an object
- Object Property Expressions:
These expressions return an object property
- Function Definition Expressions:

These expressions return a function
On the other hand, Most JavaScript programs contain JavaScript statements . The statements are executed, one by one in the same order as they are written.
We can see that , the statements are executed one by one and after statement 4 the result is executed.
Reference: https://eloquentjavascript.net/