Skip to content

Latest commit

 

History

History
176 lines (124 loc) · 4.42 KB

File metadata and controls

176 lines (124 loc) · 4.42 KB

JavaScript Concepts and Practice Repository

Welcome to the JavaScript Concepts Repository — a well-structured collection of files and folders designed to help you learn, practice, and master key JavaScript topics through hands-on examples.


Project Structure

Each folder below focuses on a specific JavaScript concept or feature.


1. array-methods/

Learn the most common and powerful array methods in JavaScript.

Files:

  • main.js – Demonstrates methods such as:
    • map(), filter(), reduce(), forEach(), find(), every(), some(), sort(), and includes().

Key Concepts:

  • Array iteration and transformation
  • Functional programming using arrays

2. async-methods/

Understand how JavaScript handles asynchronous operations.

Files:

  • callbacks.js – Basics of callback functions and asynchronous execution.
  • promises.js – Creating and chaining Promises.
  • asyncAwait.js – Using async/await syntax.
  • fetchAPI.js – Fetching data from APIs using fetch().
  • timing-methods.js – Using setTimeout and setInterval.
  • README.md – Notes and explanations.

Key Concepts:

  • Event loop and concurrency
  • Promise-based workflows
  • Asynchronous patterns and timing control

3. date-methods/

Learn how to work with JavaScript’s Date object.

Files:

  • main.js – Examples of:
    • Creating dates, formatting, getting day/month/year, and working with timestamps.

Key Concepts:

  • Date manipulation and formatting
  • Calculating time differences

4. DOM-methods/

Explore how JavaScript interacts with the Document Object Model (DOM).

Files:

  • index.html – Example HTML file for testing.
  • main.js – Selecting, creating, and modifying HTML elements.

Key Concepts:

  • DOM selection methods (getElementById, querySelector, etc.)
  • Event handling
  • Dynamic content manipulation

5. error-handling/

Understand how to properly handle and throw errors.

Files:

  • throwError.js – How to create and throw custom errors.
  • tryCatch.js – Using try, catch, and finally.

Key Concepts:

  • Exception handling
  • Custom error creation
  • Defensive programming

6. ES6-features/

Dive into modern JavaScript (ES6+) syntax and functionalities.

Files:

  • arrowFunctions.js – Shorter syntax for writing functions.
  • destructuring.js – Unpacking arrays and objects.
  • restOperator.js – Collecting remaining arguments.
  • spreadOperator.js – Spreading array/object values.
  • templateLiterals.js – Dynamic string interpolation.

Key Concepts:

  • Cleaner, modern syntax
  • Code readability improvements
  • Working with complex data structures

7. json-handling/

Work with JSON (JavaScript Object Notation) data formats.

Files:

  • parse.js – Convert JSON strings into JavaScript objects.
  • stringify.js – Convert JavaScript objects into JSON strings.

Key Concepts:

  • Data serialization and deserialization
  • Storing and transmitting structured data

8. Math-methods/

Learn useful mathematical functions in JavaScript.

Files:

  • main.js – Examples using:
    • Math.round(), Math.ceil(), Math.floor(), Math.random(), Math.max(), Math.min(), and more.

Key Concepts:

  • Random number generation
  • Basic arithmetic operations
  • Rounding and precision control

9. object-methods/

Master how to handle and manipulate JavaScript objects.

Files:

  • main.js – Examples of:
    • Object creation, copying, merging, freezing, keys/values iteration, and destructuring.

Key Concepts:

  • Object manipulation
  • Deep vs shallow copy
  • Object immutability

10. string-methods/

Explore powerful string handling in JavaScript.

Files:

  • main.js – Demonstrates:
    • toUpperCase(), toLowerCase(), slice(), substring(), replace(), includes(), split(), trim(), etc.

Key Concepts:

  • String formatting and searching
  • Substring extraction
  • Character manipulation

What You’ll Learn

  • JavaScript Core Fundamentals
  • Modern ES6+ Syntax
  • DOM Manipulation
  • Error and Exception Handling
  • Asynchronous Programming (Callbacks, Promises, Async/Await)
  • JSON Parsing and API Integration
  • String, Array, and Object Utilities
  • Mathematical and Date Operations

How to Run

  1. Clone the repository
    git clone https://github.com/davemOps/javascript-concepts.git