From db5caa0a6491d76b53efec46125dcf7cfe516418 Mon Sep 17 00:00:00 2001 From: HS <24558802+h-s04@users.noreply.github.com> Date: Sat, 27 Aug 2022 18:10:36 +0800 Subject: [PATCH] Add content for expressions and operators (#1618) * Update 108-javascript-expressions-and-operators * Update content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/readme.md Co-authored-by: Kamran Ahmed --- .../108-javascript-expressions-and-operators/readme.md | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/readme.md b/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/readme.md index 8634a88e8..c5bf1c3b6 100644 --- a/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/readme.md +++ b/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators/readme.md @@ -1 +1,6 @@ -# Javascript expressions and operators \ No newline at end of file +# 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 `+`. + +Free Content +Expressions and operators