For example, when you create a variable, you write a statement:
let number = 100;
As I mentioned above, a statement can be just an expression, as in the following example:
js> 1; 1
You can do the same thing with a variable:
js> let name = "Brendan"; js> name "Brendan"
These operators are binary operators, meaning there must be values on either side of the operator. The
+ operator and the
-operator can also be used as unary operators, in which can they are used to distinguish the sign (positive or negative) of a number.
You can use parentheses to modify the order of operations. When an arithmetic expression is placed inside parentheses, that expression is evaluated before any other operations.
For example, take the expression:
let n = 100 + 3 * 22;
n get the value 2266, 103 * 26, or does the variable get the value 166? Without parentheses the value of
n is 166 because the multiplication takes place before the addition due to the precedence of the multiplication operator over the addition operator.
Although we still talk about programming as a standalone career, the dominance of technology in our lives makes it clear that coding is much more than a career path. In my opinion, computer science is more than a college major or a high-paid job; it’s a skill, essential for thriving in a modern-day economy. Whether you work in healthcare, marketing, business, or other fields, you will see more coding and have to deal with a growing number of technologies throughout your entire life.