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 :
- String Expressions:
- Array and Object Expressions:
- Logical Expressions :
- Object Creation Expressions:These expressions return an object
- Object Property Expressions:
- Function Definition Expressions:
We can see that , the statements are executed one by one and after statement 4 the result is executed.