View the full blogs:
JavaScript hass both binary and unary operators, and a special ternary operator, the conditional operator.
A binary operator requires two operands, one before the operator and one after:
operand1 operator operand2
Ex: 3+4 or x*y
A unary operator requires a single operand, either before or after the operator:
operator operand
Ex: x++ or ++x
An assignment operator assigns a value to its left operand based on the value of its right operand.
Simple assignment operator is equal (=)
x = f()
Assigning to properties - if a variable refers to an object then the left-hand side of an assignment expression may make assignments to properties of that variable
Destructuring - extract data from arrays or objects using a syntax that mirrors the construction of array and object literals
Evaluation and nesting - by chaining or nesting an assignment expression, its results can itself be assigned to another variable. It can be logged, it can be put inside an array literal or function call, and so on.
A comparison operator compares its operands and returns a logical value based on whether the comparison is true.
View the table for comparision operators but clicking the link above for ‘Expressions and Operators’
A for statement - a ‘for’ loop repeats until a specified condition evalutaes to false. It looks as follows:
for ([initialExpression]; [conditionExpression]; [incrementExpression])
statement
A while statement executes its statement as long as a specified condition evaluates to ‘true’. A while statements looks as follows:
while (condition)
statement