Files
developer-roadmap/content/roadmaps/106-javascript/content/108-javascript-expressions-and-operators
FercueNatandKamran Ahmed 2242802e1a Fix content resource headings in js roadmap (#2616)
* Adding information on QA SDLC Delivery Model node

* Update content/roadmaps/113-qa/content/101-qa-sdlc/readme.md

* Tweaking files in the Chrome Dev Tools section - JS roadmap

* Tweaking format on files from Memory Management - JS roadmap

* Fixed issue with one of the Free Contents - CommonJS readme

* Format tweak on Callback nodes - JS Roadmap

* Format tweaks on different files from the Expressions and Operators tree

Co-authored-by: Kamran Ahmed <kamranahmed.se@gmail.com>
2022-10-21 20:23:42 +05:00
..

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