⚡ JavaScript Learning Hub

⬅ Back to Main Page
0 / 0 topics explored (0%)

Learn JavaScript

Explore 40+ interactive topics — from variables to async/await. Click any card, read the explanation, run live code, and test yourself with a quiz.

⚡ JavaScript Basics

<script> Tag
Embed or link JavaScript in an HTML page
Click for details
console.log()
Print output to the browser's developer console
Click for details
Comments
Single-line // and multi-line /* */ code comments
Click for details
Variables (let, const, var)
Store and reference data values in your program
Click for details
Data Types
String, Number, Boolean, Null, Undefined, Object, Symbol
Click for details
Template Literals
Backtick strings with embedded expressions using ${}
Click for details
typeof Operator
Returns a string describing the type of any value
Click for details
String Methods
trim(), split(), replace(), includes(), slice() and more
Click for details
Number Methods & Math
Math.floor(), Math.random(), toFixed(), parseInt() and more
Click for details
ES Modules (import/export)
Split code into reusable files with import and export
Click for details

➕ Operators & Expressions

Arithmetic Operators
+, -, *, /, %, ** and increment/decrement
Click for details
Comparison Operators
==, ===, !=, !==, >, <, >=, <=
Click for details
Logical Operators
&& (AND), || (OR), ! (NOT) with short-circuit evaluation
Click for details
Ternary Operator
condition ? trueValue : falseValue — compact if/else
Click for details
Nullish Coalescing (??)
Safe default values: only triggers on null or undefined
Click for details
Optional Chaining (?.)
Safely access nested properties without errors
Click for details

🔀 Control Flow

if / else
Execute different code based on conditions
Click for details
switch Statement
Match a value against multiple cases efficiently
Click for details
for Loop
Classic for, for...of, and for...in iteration
Click for details
while / do...while
Repeat code while a condition is true
Click for details
break & continue
Exit a loop early or skip the current iteration
Click for details

🔧 Functions

Function Declaration
Define reusable code blocks with the function keyword
Click for details
Arrow Functions
Concise ES6 function syntax with => and lexical this
Click for details
Parameters & Arguments
Pass data into functions, including default values
Click for details
Return Values
Send data back from a function with the return keyword
Click for details
Callback Functions
Functions passed as arguments to be called later
Click for details
Rest & Spread (...)
Collect arguments into an array or expand arrays/objects
Click for details
Closures
Functions that remember their outer scope's variables
Click for details

📦 Arrays

Array Basics
Create and access ordered lists of values
Click for details
push / pop / shift / unshift
Add and remove elements from the start or end
Click for details
Array .forEach()
Execute a function for every element in an array
Click for details
Array .map()
Transform every element and return a new array
Click for details
Array .filter()
Keep only elements that pass a test function
Click for details
Array .reduce()
Accumulate all elements into a single value
Click for details
Array .find() & .findIndex()
Find the first matching element or its index
Click for details
Array .sort()
Sort elements alphabetically or numerically
Click for details
slice & splice
Extract portions or mutate arrays in-place
Click for details

🗂️ Objects

Object Basics
Store key-value pairs and access with dot or bracket notation
Click for details
Object Methods
Object.keys(), .values(), .entries(), .assign()
Click for details
this Keyword
Refers to the calling object inside a method
Click for details
Destructuring
Unpack arrays and object properties into variables
Click for details
Spread with Objects
Copy and merge objects with the spread operator
Click for details
ES6 Classes
Blueprint for objects with constructor and methods
Click for details

🌐 DOM Manipulation

getElementById()
Select a single element by its unique ID
Click for details
querySelector & querySelectorAll
Select elements using CSS selector syntax
Click for details
classList Methods
add, remove, toggle, and contains CSS classes
Click for details
Style Manipulation
Set inline CSS properties via element.style
Click for details
createElement & appendChild
Dynamically create and insert HTML elements
Click for details
Removing Elements
Delete elements from the DOM with .remove()
Click for details

🎯 Events

addEventListener()
Attach event handlers to elements cleanly
Click for details
Keyboard Events
keydown, keyup — detect which key was pressed
Click for details
Form Events
submit, input, change — handle form interactions
Click for details
Event Bubbling & Delegation
Handle child events via a single parent listener
Click for details

⏳ Async JavaScript

Promises
Handle future values with .then(), .catch(), .finally()
Click for details
async / await
Write async code that reads like synchronous code
Click for details
fetch API
Make HTTP requests to APIs and handle JSON responses
Click for details
try / catch / finally
Handle errors gracefully with structured error handling
Click for details
JSON
Parse and stringify data for APIs and storage
Click for details

🛠️ Browser APIs

localStorage
Persist data in the browser across sessions
Click for details
sessionStorage
Temporary storage that clears when the tab closes
Click for details
setTimeout & setInterval
Run code after a delay or on a repeating schedule
Click for details
Clipboard API
Copy text to the clipboard programmatically
Click for details
Date Object
Work with dates and times in JavaScript
Click for details