This repository covers fundamental concepts of JavaScript, providing a solid foundation for any beginner to start their JavaScript journey.
- Arrays
Arrays are used to store multiple values in a single variable.
- This section covers array basics and array methods.
- DOM (Document Object Model)
The DOM represents a webpage so that programs can change the document structure, style, and content.
- This section covers DOM manipulation techniques including selecting elements, changing styles, adding event listeners, handling form inputs, and modifying the DOM.
- Events
Events are actions that occur when the user interacts with the webpage.
- This section covers DOM events, form events, the
thiskeyword, and more.
- Functions
Functions are reusable blocks of code that perform specific tasks and can be called with different inputs. They help organize code and improve efficiency.
- This section covers function declarations, expressions, higher-order functions, and factory functions.
- Learn about scope, async functions, and more.
- Loops
Loops execute code repeatedly.
- This section covers
for,for...of,for...in, andwhileloops. - Learn to iterate over arrays, strings, nested arrays, and objects using practical examples to calculate totals and averages.
- Objects
Objects are collections of key-value pairs and are fundamental to JavaScript programming.
- This section covers declaring and initializing objects, using
constwith objects, accessing object properties using dot and bracket notation, working with numeric keys, and using variables to access properties. - Additionally, it includes examples of nested arrays and objects, as well as accessing nested object properties.
- Learn how to create, manipulate, and traverse objects effectively.
- Operators
Operators are symbols used to perform operations on values and variables. They help in calculations and decision-making. This section includes:
-
Arithmetic Operators:
- Addition (
+): Adds two values. - Subtraction (
-): Subtracts one value from another. - Multiplication (
*): Multiplies two values. - Division (
/): Divides one value by another. - Modulus (
%): Returns the remainder of a division.
- Addition (
-
Logical Operators
- AND (
&&): Checks if both conditions are true. - OR (
||): Checks if at least one condition is true. - NOT (
!): Checks if a condition is false.
- AND (
- AJAX & APIs
AJAX (Asynchronous JavaScript and XML) has evolved into AJAJ (Asynchronous JavaScript and JSON).
- This section covers making HTTP requests using JSON, parsing JSON data, and interacting with web-based APIs.
- Learn how to convert JSON strings to JavaScript objects using
JSON.parse, handle sample JSON data, and use reviver functions. - Explore examples of using modern tools and techniques to efficiently share data between systems over the internet.
- Asynchronous Programming in JavaScript (async/await)
Asynchronous programming is essential for improving the performance and responsiveness of web applications.
- This section covers the use of
setTimeout, Promises, async/await, and handling asynchronous operations. - You'll learn how to manage the call stack, avoid callback hell, and chain Promises.
- Examples include functions for changing colors sequentially using Promises, handling fake HTTP requests with callbacks and Promises, and visualizing the call stack using tools like Chrome DevTools and Loupe.
- Classes
Classes are templates for creating objects in JavaScript.
- This section explains how to define and use classes with constructors, properties, and methods.
- You'll learn how to create instances of a class and use methods such as
rgb(),hex(),rgba(),hsl(),fullSaturation(), andopposite(). - The examples include converting colors between RGB, HEX, RGBA, and HSL formats, calculating HSL values, and styling HTML elements with these color instances.
- Explore how classes encapsulate functionality and make your code more modular and reusable.
- JavaScript ES6: Understanding extends & super
Theextendskeyword is used to create a class that is a child of another class. Thesuperkeyword is used to access properties and methods of the parent class.
- This section covers inheritance in JavaScript.
-
Making HTTP Requests
Learn how to make HTTP requests using fetch, axios, and XML API methods to interact with web servers. -
Async Operations with setTimeout & setInterval
These functions are used to execute code after a set period or repeatedly at specified intervals.
- This section covers how to use them effectively.
- Truthy & Falsy Values Understanding truthy and falsy values is crucial for writing accurate conditional statements.
- This section explains what values are considered truthy or falsy in JavaScript.
- Exception Handling Mechanisms: Try & Catch
Error handling is an essential part of programming.
- Learn how to handle errors using
tryandcatchblocks.
- Variables & Data Types
Variables store data values and are declared usingvar,let, orconst. Data types determine the kind of data a variable can hold.
- This section includes files on declaring variables, primitive data types, and type conversion.
- Clone the repository:
git clone https://github.com/Misba0019/JavaScript_basics.git- Navigate to the project folder:
cd JavaScript_basics-
Open the files in a browser:
Open any of the.htmlfiles in your browser to view the examples. -
Explore the Code:
Open the.jsfiles in a code editor (e.g., VS Code) to review the JavaScript code.
OR
- Run the Code Locally:
For interactive examples, open the browser's developer console to see the output of the JavaScript code.
⭐ If you find this project helpful, please consider visiting the repo and giving it a ⭐ star — it really helps!
This project is licensed under the MIT License. See the LICENSE file for details.