reading-notes

class 8 notes

Expressions and Operators

Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Expressions_and_Operators

Comparison Operators

Assignment Operators

Examples of compound assignment operators:

  1. assignment: x = f()
  2. addition assignment: x += f()
  3. subtraction assignment x -= f()
  4. multiplication assignment x *= f()
  5. division assignment x /= f()

Assigning to properties

Example: ‘const obj = {};

obj.x = 3; console.log(obj.x); // Prints 3. console.log(obj); // Prints { x: 3 }.

const key = “y”; obj [key] = 5; console.log(obj[key]); // Prints 5. console.log(obj); // Prints { x: 3, y: 5}’

Destructuring

Evaluation and Nesting

Avoid Assignment Chains


Loops

Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Loops_and_iteration#for_statement

For Statement

Example: ‘ for ([initialExpression]; [conditionExpression]; [incrementExpression]) statement’

While Statement

Example: ‘while (condition) statement’

Things I Want To Know More About

Nothing at this time

URL: https://s-glass.github.io/reading-notes/102/class8notes