Operator
An operator is a symbol or keyword in source code that represents a built-in function.
Related concepts: Function
Closest Wikipedia entry: Operator (computer programming) — In computer programming, operators are constructs defined within programming languages which behave generally like functions, but which differ syntactically or semantically. Common simple examples include arithmetic (e.g. addition with +), comparison (e.g. "greater than" with >), and logical operations (e.g. AND, also written && in some languages). More involved examples include assignment (usually = or :=), field access in a record or object (usually .), and the scope resolution operator (often :: or .).
Misconceptions about Operator28 documented Misconceptions
Check YourselfArithmeticPlusPrecedes
Addition has higher precedence than string concatenationArrayAccessWithParentheses
Parenthesis are used to access an element in an arrayAssignCompares
= compares two valuesAssignmentNotExpression
An assignment a=b is not an expressionCannotChainMemberAccesses
Member accesses cannot be chained togetherCannotChainMemberToConstructor
Method calls or field accesses cannot be chained to a constructor invocationComparisonWithBooleanLiteral
To test whether an expression is true or false, one must compare it to true or to falseEqualityOperatorComparesObjectsValues
o==p compares the objects referred to by variables o and pMapToBooleanWithConditionalOperator
To map a boolean expression to a boolean, a conditional operator is necessaryNoAtomicExpression
Expressions must consist of more than one pieceNoShortCircuit
&& and || always evaluate both operandsNoSingleLogicAnd
& is only a bitwise ANDPreIncrementBeforeLoop
Pre-increment in update part of for loop means increment before loop bodyRightToLeftChaining
Chained accesses are invoked from right to leftStringPlusStringifiesExpression
String concatenation stringifies non-String operand expressions