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 — Java
Addition has higher precedence than string concatenationArrayAccessWithParentheses — Java
Parenthesis are used to access an element in an arrayAssignCompares — Java
= compares two valuesAssignCompares — Python
= compares two valuesAssignmentNotExpression — Java
An assignment a=b is not an expressionCannotChainAttributeToObjectInstantiation — Python
Method calls, and attribute accesses in general, cannot be chained to a constructor invocation.CannotChainMemberAccesses — Java
Member accesses cannot be chained togetherCannotChainMemberToConstructor — Java
Method calls or field accesses cannot be chained to a constructor invocationCompareBooleanToConstant — Scratch
To test whether an expression evaluates to true or false, one must compare it to a constantComparisonWithBoolLiteral — Python
To test whether an expression is True or False, one must compare it to True or to FalseComparisonWithBooleanLiteral — Java
To test whether an expression is true or false, one must compare it to true or to falseConditionalOperatorNotExpression — JavaScript
The conditional operator is not an expressionEqualityOperatorComparesObjectsValues — Java
o==p compares the objects referred to by variables o and pEqualityOperatorComparesObjectsValues — JavaScript
The equality operator compares two objects' valuesEqualityOperatorComparesOnlyTypes — JavaScript
The equality operator '==' compares only the types of the operandsEqualityOperatorComparesOnlyTypes — Scratch
() = () compares only the types of its operandsMapToBooleanWithConditionalOperator — Java
To map a boolean expression to a boolean, a conditional operator is necessaryMapToBooleanWithTernaryOperator — Python
To map a boolean expression to a bool, a ternary conditional operator is necessaryNoAtomicExpression — Java
Expressions must consist of more than one pieceNoAtomicExpression — JavaScript
Expressions must consist of more than one pieceNoAtomicExpression — Python
Expressions must consist of more than one pieceNoShortCircuit — Java
&& and || always evaluate both operandsNoShortCircuit — Python
and/or always evaluate both operandsNoSingleLogicAnd — Java
& is only a bitwise ANDPlusConcatenatesNumbers — Python
The plus operator can concatenate strings and numbersPreIncrementBeforeLoop — Java
Pre-increment in update part of for loop means increment before loop bodyRightToLeftChaining — Java
Chained accesses are invoked from right to leftStringPlusStringifiesExpression — Java
String concatenation stringifies non-String operand expressions