ITSE 1411 Beginning Web
JS Module 1 Discussion Expressions
Discussion
- Building Expressions
- In math you solved equations. There are NO equations in programming. You solve expressions and
assign the result of the expression to a variable. The operators are similar to the operators
you used in math, except as shown previously + can mean either addition or concatenation. And,
in math you used several different options to mean multiplication. In JavaScript, you only use
the asterisk (*) to mean multiplication. An example of a JavaScript expression is:
interest = principal * rate * time;
That statement means to solve the expression that multiplies variables named principal, rate,
and time, then assign the result to a variable named interest.