🧾 Basic Syntax

  • Use console.log() for output
    javascript_syntax
  • Comments: // single line or /* multi-line */
  • Indent with 2 spaces or tabs
    code_indentation

🧪 Data Types

  • Primitive types: string, number, boolean, null, undefined, symbol
  • Arrays: const arr = [1, 2, 3]
  • Objects: const obj = { key: 'value' }
    data_types

🔄 Control Structures

  • Conditional: if (condition) { ... } else if (...) { ... } else { ... }
  • Loops:
    for (let i = 0; i < 5; i++) { ... }
    while (condition) { ... }
    do { ... } while (condition)
    
    for_loop

🧠 Functions

  • Function declaration:
    function myFunction() { ... }
    
  • Arrow functions: const sum = (a, b) => a + b
  • Parameters: function greet(name = 'Guest') { ... }
    function_declaration

🧱 Objects & Arrays

  • Object methods:
    const person = {
      name: 'Alice',
      greet: function() { ... }
    };
    
  • Array methods: .map(), .filter(), .reduce()
    array_methods

🚀 ES6+ Features

  • Template literals: `` Hello ${name} `
  • Destructuring:
    const { name, age } = person;
    
  • Spread operator: const newArr = [...arr, 4, 5]
    es6_features

⚠️ Common Errors

  • Forgetting semicolons
  • Using == instead of ===
  • Scope issues with var vs let
    common_errors

For deeper understanding, check our JavaScript Fundamentals tutorial.