From 52fdd8f07d05119c3ed028c4f6ecd500575144f2 Mon Sep 17 00:00:00 2001 From: Dominik Galiev <92969613+telesium@users.noreply.github.com> Date: Tue, 9 Jan 2024 13:44:24 +0500 Subject: [PATCH] fix: missing syntax (#5005) --- .../content/108-javascript-expressions-and-operators/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/roadmaps/javascript/content/108-javascript-expressions-and-operators/index.md b/src/data/roadmaps/javascript/content/108-javascript-expressions-and-operators/index.md index e1332e623..118aa82bc 100644 --- a/src/data/roadmaps/javascript/content/108-javascript-expressions-and-operators/index.md +++ b/src/data/roadmaps/javascript/content/108-javascript-expressions-and-operators/index.md @@ -1,6 +1,6 @@ # Expressions and Operators -At a high level, an expression is a valid unit of code that resolves to a value. There are two types of expressions: those that have side effects (such as assigning values) and those that purely evaluate. The expression `x = 7` is an example of the first type. This expression uses the `=` operator to assign the value seven to the variable x. The expression itself evaluates to 7. The expression `3 + 4` is an example of the second type. This expression uses the `+` operator to add `3` and `4` together and produces a value, `7`. However, if it's not eventually part of a bigger construct (for example, a variable declaration like const `z = 3 + 4`), its result will be immediately discarded `—` this is usually a programmer mistake because the evaluation doesn't produce any effects. As the examples above also illustrate, all complex expressions are joined by operators, such as `=` and `+`. +At a high level, an expression is a valid unit of code that resolves to a value. There are two types of expressions: those that have side effects (such as assigning values) and those that purely evaluate. The expression `x = 7` is an example of the first type. This expression uses the `=` operator to assign the value seven to the variable x. The expression itself evaluates to 7. The expression `3 + 4` is an example of the second type. This expression uses the `+` operator to add `3` and `4` together and produces a value, `7`. However, if it's not eventually part of a bigger construct (for example, a variable declaration like `const z = 3 + 4`), its result will be immediately discarded `—` this is usually a programmer mistake because the evaluation doesn't produce any effects. As the examples above also illustrate, all complex expressions are joined by operators, such as `=` and `+`. Visit the following resources to learn more: