Expression

Expression is a piece of code that produces a value.

Here is a small example,

// These are expression and it is gonna produce a value
3 + 4
6 - 3
4 / 2
true && false && !true

JavaScript has the following expression categories :

1. String Expressions:

String expressions are expressions that evaluate a string.

'hello';

2. Logical Expression

Expressions that evaluate the boolean value true or false are considered to be logical expressions.

10>4
10<5

3. Left-hand-side Expressions:

Left-hand-side expressions are those that can appear on the left side of an assignment expression.

// variables such as a
a =10;
// elements of arrays
b[3] = 3;

4. Assignment Expressions:

When expressions use the = operator to assign a value to a variable, it is called an assignment expression.

b = 32;
age = 43;
str = `You are dumb 😂`


Statements