diff --git a/docs/javascript/04-operator/04-operator.md b/docs/javascript/04-operator/04-operator.md index 202483b6..4f8d8974 100644 --- a/docs/javascript/04-operator/04-operator.md +++ b/docs/javascript/04-operator/04-operator.md @@ -797,9 +797,9 @@ This **typeof** operator helps us to know the type of data, whether it is boolea @@ -851,9 +852,12 @@ This **comma operator** evaluates each of its operands (from left to right) and > Value of x is :- 2
> Value of y is :- 3
> Value of z is :- 4
+> output of result is :- 3
In this example, the `comma operator` is used to evaluate the expressions x++, y++, and z++ sequentially. The variables x, y, and z are all `incremented by 1` as part of the evaluation. +The value 3 is assigned to result because the `comma operator` evaluates all expressions from left to right and returns the value of the last expression. Since z++ is a post-increment operator, it returns the old value of z, which is 3. + **3. STRING Operator:** This **string operator** is primarily used for concatenation, which means joining two or more strings together. In JavaScript, the`+`operator is used for this purpose. @@ -869,11 +873,11 @@ This **string operator** is primarily used for concatenation, which means joinin