-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path2-Expression.js
More file actions
28 lines (18 loc) · 973 Bytes
/
2-Expression.js
File metadata and controls
28 lines (18 loc) · 973 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
/*
Definition: Something which evaluates to a value. Example: 3*a, a=b*4
or
Statements are made up of one or more expressions.
“expression” is a combination of values and functions that are combined and interpreted by the compiler to create a new value.
Statements are made up of one or more expressions. An expression is any reference to a variable or value, or a set of variable(s) and
value(s) combined with operators.
*/
//For example:
a = b * 2;
//This statement has four expressions in it:
//• 2 is a literal value expression.
//• b is a variable expression, which means to retrieve its current value.
//• b * 2 is an arithmetic expression, which means to do the multi‐plication.
//• a = b * 2 is an assignment expression, which means to assign
//the result of the b * 2 expression to the variable a (more on assignments later).
//A general expression that stands alone is also called an expression statement, such as the following:
b * 2;