layout | title | permalink |
---|---|---|
page |
102.07 Reading Notes |
/102-07/ |
- Unary: Single operand (before or after)
- Binary: Two operands, one before and one after operator
- Ternary: Conditionals
- Assign first (left) operand a value determined by the second (right) operand
=
is the simplest assignment operator, assigning the second operand value to the first operand- Compound assignment operators abbreviate operations (Listed Here)
- Can be used to evaluate a variable and assign a new value, like:
a = f();
, which would assign the value/result off()
to variablea
; or:let b = z();
which results in an initial assignment forb
of the value ofz()
- Can be chained/nested--to be used with caution-- to be used in function calls assingment of other variables, and more (right-associative, evaluated left-to-right)
- Return a logic value depending on the comparison ("true")
- Converts some values to equivalent type if possible
===
and!==
(equality and inequality operators) do not convert- (Listed Here)
- Return a single numerical value
- Standard arithmetics (
+``-``*``/
) as well as others listed Here - Can be used with strings (like for concatenation of text with
+
)
&&
- logical "and"||
- logical "or"!
- logical "not"
- Take input and return related output
- Must be defined from where it is called
- Anatomy: Name, parenthetical parameters (with commas between), JavaScript definition (in curled brackets)
- Names can contain letters, digits,
_
, and$
- The values received by the function when invoked are called arguments, which are locally variables within the function
- Declared with the
function
keyword, setting the following text as the declared function's name, like:function TriAdd(firsts, seconds, thirds) { return firsts+seconds+thirds; }
- User-defined objects that are parameters can be changed outside the scope of that function
- The definition of a function does not execute it
- Calling the function executes it
- Control Flow: Order of execution of script statements
- Executes from top line to bottom except for conditional or looping structures