Skip to content

Latest commit

 

History

History
491 lines (349 loc) · 13.5 KB

File metadata and controls

491 lines (349 loc) · 13.5 KB

🚀 JavaScript Mastery - Complete Learning Repository

JavaScript Node.js License PRs Welcome

A comprehensive, production-ready JavaScript learning repository with 50+ practical examples

Getting StartedDocumentationExamplesContributing

🎯 About The Project

This repository is a complete JavaScript learning ecosystem designed for developers at all levels. From absolute beginners to intermediate programmers, this collection provides structured, well-documented, and practical code examples covering core JavaScript concepts to advanced asynchronous programming.

✨ Features

Feature Description
🎓 Beginner Friendly Start from zero with clear explanations
🔥 ES6+ Modern Syntax Learn contemporary JavaScript
📦 Modular Structure Each topic in dedicated folders
💻 Practical Examples Run code immediately in Node.js or browser
📝 Detailed Comments Understand every line of code
🎨 DOM Projects Interactive web development examples
🌐 API Integration Real-world API handling
Async Programming Promises and async operations
🧪 Ready to Execute All examples tested and working
🤝 Community Driven Open for contributions

📁 Folder Structure

javascript-practice/
│
├── 📂 01_basics/                    # JavaScript Fundamentals
│   ├── 01_variables_basics.js      # var, let, const
│   ├── 02_hoisting_scope.js        # Hoisting & scope concepts
│   ├── 03_datatypes.js             # Primitive & reference types
│   ├── 04_operators_basics.js      # Arithmetic, assignment operators
│   ├── 05_comparison_operators.js  # Equality & comparison
│   └── README.md
│
├── 📂 02_functions/                 # Functions & Context
│   ├── 01_function_types.js        # Declaration, expression, arrow, IIFE
│   ├── 02_arrow_functions_callbacks.js  # ES6 functions & callbacks
│   ├── 03_this_keyword_basics.js   # Understanding 'this'
│   ├── 04_this_keyword_advanced.js # Lexical binding
│   └── README.md
│
├── 📂 03_data_structures/           # Objects & Arrays
│   ├── 01_objects_basics.js        # Object creation, methods, JSON
│   ├── 02_arrays_basics.js         # Array fundamentals
│   ├── 03_array_methods.js         # forEach, iteration
│   ├── 04_map_filter_reduce.js     # Higher-order functions
│   └── README.md
│
├── 📂 04_built_in_objects/          # Built-in APIs
│   ├── 01_date_methods.js          # Date manipulation
│   ├── 02_number_math.js           # Number formatting, Math object
│   ├── 03_string_methods.js        # String operations
│   └── README.md
│
├── 📂 05_control_flow/              # Logic & Iteration
│   ├── 01_conditionals.js          # if-else, switch, ternary
│   ├── 02_loops.js                 # for, while, for...in, for...of
│   └── README.md
│
├── 📂 06_async_programming/         # Asynchronous JavaScript
│   ├── 01_promises_basics.js       # Promise fundamentals
│   ├── 02_promises_practice.js     # Chaining & error handling
│   ├── APIrequest.html             # Promise examples
│   └── README.md
│
├── 📂 07_dom_manipulation/          # Web Development
│   ├── index.html                  # HTML structure
│   ├── main.js                     # DOM manipulation scripts
│   └── README.md
│
└── 📂 08_api_integration/           # Real-world APIs
    ├── index.html                  # UI structure
    ├── main.js                     # Fetch API implementation
    ├── style.css                   # Styling
    └── README.md

📖 Topics Covered

🔹 01. JavaScript Basics

Click to expand

Variables & Data Types

  • Variable declarations: var, let, const
  • Hoisting behavior and temporal dead zone
  • Block scope vs function scope
  • Primitive types: Number, String, Boolean, Undefined, Null, Symbol, BigInt
  • Reference types: Objects, Arrays, Functions
  • Type checking with typeof and instanceof
  • Type conversion and coercion

Operators

  • Arithmetic operators: +, -, *, /, %, **
  • Assignment operators: =, +=, -=, *=, /=
  • Comparison operators: ==, ===, !=, !==, >, <, >=, <=
  • Logical operators: &&, ||, !
  • Increment/Decrement: ++, --
  • Ternary operator: ? :

Files:


🔹 02. Functions

Click to expand

Function Types

  • Function declarations
  • Function expressions
  • Arrow functions (ES6)
  • Anonymous functions
  • IIFE (Immediately Invoked Function Expressions)

Advanced Concepts

  • Callback functions
  • Higher-order functions
  • Function parameters and arguments
  • Return values
  • this keyword in different contexts
  • Lexical binding in arrow functions
  • call(), apply(), bind() methods

Files:


🔹 03. Data Structures

Click to expand

Objects

  • Object creation: literal notation, new Object()
  • Property access: dot notation, bracket notation
  • Object methods: Object.keys(), Object.values(), Object.entries()
  • JSON: JSON.stringify(), JSON.parse()
  • Object destructuring
  • Property deletion

Arrays

  • Array creation and initialization
  • Accessing elements by index
  • Array methods: push(), pop(), shift(), unshift()
  • Iteration: forEach(), map(), filter(), reduce()
  • Array transformation and manipulation
  • splice(), slice(), concat(), join()
  • Array searching: indexOf(), includes(), find()

Files:


🔹 04. Built-in Objects

Click to expand

Date Object

  • Creating dates: new Date()
  • Formatting methods: toString(), toISOString(), toLocaleString()
  • Getter methods: getFullYear(), getMonth(), getDate(), getDay()
  • Time methods: getHours(), getMinutes(), getSeconds()
  • Timestamp: getTime()

Number & Math

  • Number formatting: toFixed(), toPrecision(), toLocaleString()
  • Number parsing: parseInt(), parseFloat()
  • Math methods: abs(), round(), ceil(), floor()
  • Math utilities: max(), min(), random()
  • Mathematical constants: Math.PI, Math.E

String Methods

  • Case conversion: toUpperCase(), toLowerCase()
  • Character access: charAt(), charCodeAt()
  • String manipulation: concat(), slice(), substring()
  • Searching: indexOf(), includes(), startsWith(), endsWith()
  • Template literals

Files:


🔹 05. Control Flow

Click to expand

Conditional Statements

  • if statement
  • if-else statement
  • else if chains
  • switch statement
  • Ternary operator ? :
  • Truthy and falsy values
  • Logical operators in conditions

Loops

  • while loop
  • do...while loop
  • for loop
  • for...in loop (objects and arrays)
  • for...of loop (iterables)
  • break and continue statements
  • Nested loops

Files:


🔹 06. Async Programming

Click to expand

Promises

  • Promise creation: new Promise()
  • Promise states: pending, fulfilled, rejected
  • resolve() and reject() methods
  • .then() for handling success
  • .catch() for error handling
  • .finally() for cleanup
  • Promise chaining
  • Error propagation

Advanced Async Patterns

  • Multiple promises handling
  • Callback hell vs Promises
  • Real-world async examples

Files:


🔹 07. DOM Manipulation

Click to expand

DOM Concepts

  • DOM selection methods
  • Element creation and manipulation
  • Event listeners
  • Event handling
  • Dynamic content updates
  • Style manipulation
  • Class list operations

Files:


🔹 08. API Integration

Click to expand

Working with APIs

  • Fetch API basics
  • Making HTTP requests (GET, POST)
  • Handling API responses
  • Error handling in API calls
  • Parsing JSON data
  • Updating DOM with API data
  • Real-world API examples

Files:


🚀 Getting Started

Prerequisites

Before you begin, ensure you have the following installed:

  • Node.js (v14 or higher) - Download
  • Modern Web Browser (Chrome, Firefox, Edge, Safari)
  • Code Editor - VS Code (Recommended)

Installation

  1. Clone the repository

    git clone https://github.com/codezenashish/javascript-practice.git
  2. Navigate to the directory

    cd javascript-practice
  3. Install dependencies (if any)

    npm install

Quick Start Example

# Run your first example
node 01_basics/01_variables_basics.js

# Output: Variable values and data types

🤝 Contributing

Contributions make the open-source community an amazing place to learn and create. Any contributions you make are greatly appreciated!

How to Contribute

  1. Fork the Project
  2. Create your Feature Branch
    git checkout -b feature/AmazingFeature
  3. Commit your Changes
    git commit -m 'Add some AmazingFeature'
  4. Push to the Branch
    git push origin feature/AmazingFeature
  5. Open a Pull Request

Contribution Guidelines

  • Follow existing code style and structure
  • Add detailed comments explaining your code
  • Update README if adding new sections
  • Test your code before submitting
  • One feature per pull request

📚 Resources

Official Documentation

Learning Resources

Practice Platforms


📄 License

Distributed under the MIT License. See LICENSE for more information.


🙏 Acknowledgments

  • MDN Web Docs for comprehensive JavaScript documentation
  • JavaScript.info for detailed tutorials
  • Open-source community for inspiration and best practices
  • All contributors who help improve this repository

📬 Contact

Ashish Chaudhary


⭐ Show Your Support

If this repository helped you learn JavaScript, please give it a ⭐ star!

Share this repo with others who are learning JavaScript!


🚀 Start Your JavaScript Journey Today!

Explore Code Examples →

Made with ❤️ by developers, for developers