Skip to content

codezenashish/javascript-practice

Repository files navigation

πŸš€ JavaScript Mastery - Complete Learning Repository

JavaScript Node.js License PRs Welcome

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

Getting Started β€’ Documentation β€’ Examples β€’ Contributing

🎯 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

About

JavaScript Learning Journey - Daily Notes & Code Practice Covering Basics to Advanced Concepts (ES6+, DOM, Async, etc.) Includes Code Snippets, Examples, and Mini-Exercises No Full Projects, Only Step-by-Step Learning Daily/Regular Updates

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors