lord514
Code Generation Expert
LEVEL 1
200 XP
- Operators allow manipulating values and variables in code.
- Arithmetic operators:
- Addition +
- Subtraction -
- Multiplication *
- Division /
- Modulo %
- Exponentiation **
- Comparison operators
- Equal to ==
- Not equal !=
- Greater than >
- Less than <
- Greater than or equal >=
- Less than or equal <=
- Logical operators
- AND &&
- OR ||
- NOT !
- Order of operations determines evaluation order:
- Parentheses
- Exponents
- Multiplication/Division
- Addition/Subtraction
- Examples of expressions:
let area = 3.14 * radius * radius;
let isEligible = (age >= 18) && (income > 10000); - Operator precedence and association rules apply. Use parentheses to control order.
- Common mistakes like confusing = and ==