My JavaScript Learning Journey

Notes, concepts, and mini projects built while learning JavaScript.

View Topics

Comments

Comments are used to explain code and make it easier for humans to understand. JavaScript completely ignores comments when running a program, so they do not affect performance or output.

View Mini Project

Variables

Variables store data to use and manipulate in programs. I learned the difference between let, const, and var, and how scope (global vs local) affects accessibility and behavior.

View Mini Project

Local Variables

Local variables protect data and make functions self-contained and predictable.

View Mini Project

Global Variables

Global variables are convenient, but if overused, they can cause unexpected changes because many parts of the program can modify them.

View Mini Project

Functions

Functions are reusable blocks of code designed to perform a specific task. Instead of writing the same logic multiple times.

View Mini Project

Functions with Parameters

A function with parameters is a function that can receive values from outside when it is called.

View Mini Project

Functions with Parameters

A function with multiple parameters is a function that receives more than one input value when it is called. Each parameter acts as a placeholder for a value the function needs in order to perform its task. Instead of limiting a function to one piece of data, multiple parameters allow it to work with several related values at the same time.

View Mini Project

Operators

Operators perform actions on values. I explored arithmetic, comparison, and logical operators, and saw how type coercion can create subtle bugs if not careful.

View Mini Project

Return Statement

The return statement is used to send a value back from a function and stop its execution. I learned that returning values makes functions reusable and allows their results to be stored, combined, or passed into other functions. Unlike console.log(), return is essential for real program logic.

View Mini Project

If / Else Statements

If and else statements let programs make decisions. I learned proper condition ordering, avoiding unreachable code, and combining multiple conditions logically.

View Mini Project

nested If Statement

Nested if statements are if statements placed inside another if statement. I learned that they are useful when one condition depends on another, but too much nesting can reduce readability. Using logical operators or restructuring conditions can make code cleaner and easier to maintain.

View Mini Project

Complex conditions

Complex conditions combine multiple simple conditions using logical operators like AND (&&), OR (||), and NOT (!). I learned that they help write cleaner decision-making logic, reduce nested if statements, and make programs more efficient and readable.

View Mini Project

Switch Cases

The switch statement is used to handle multiple choices based on a single value. I learned that it improves readability when comparing one variable against many possible values, but it requires break statements to prevent unwanted execution of other cases.

View Mini Project

Loops

Loops repeat actions efficiently. I practiced for and while loops, controlling iterations carefully to avoid infinite loops and to automate repetitive tasks.

View Mini Project

Do...While Loop

A do...while loop runs a block of code at least once before checking the condition. The condition is checked after the first execution, making it useful when the code must run at least one time.

View Mini Project

Event Handlers

Event handlers allow JavaScript to respond to user interactions such as clicks, typing, hovering, or loading a page. They help make websites interactive and responsive to user actions.

View Mini Project

onmouseover & onload

The onmouseover event occurs when a user moves their mouse over an element. The onload event runs when a webpage or resource has fully loaded. These events are commonly used for animations, messages, and initializing scripts.

View Mini Project

Objects

Objects store related data and functions together. They represent real-world entities by grouping properties and behaviors. Objects are fundamental for organizing complex data in JavaScript programs.

View Mini Project

Creating Our Own Objects

JavaScript allows developers to create custom objects that model real-world things such as a user, car, or product. These objects can contain properties and methods that define their data and behavior.

View Mini Project

Object Initializers

Object initializers provide a quick way to create objects using curly braces. They allow developers to define properties and values directly when creating the object.

View Mini Project

Adding Methods to Objects

Methods are functions stored inside objects. They allow objects to perform actions related to their properties, making objects more dynamic and useful.

View Mini Project

Arrays

Arrays are used to store multiple values inside a single variable. They are useful for managing lists of data such as numbers, names, or objects.

View Mini Project

join() and pop()

The join() method combines all elements of an array into a single string. The pop() method removes the last element from an array and returns it.

View Mini Project

Array Properties

Arrays have properties such as length, which shows the number of elements inside the array. Understanding array properties helps manage and manipulate data effectively.

View Mini Project

reverse(), push(), sort()

reverse() changes the order of elements in an array. push() adds new elements to the end of an array. sort() arranges elements in alphabetical or numerical order.

View Mini Project

Adding Array Elements with Loops

Loops can be used to add elements to arrays dynamically. This allows programs to generate or collect large sets of data efficiently.

View Mini Project

Associative Arrays

Associative arrays use named keys instead of numeric indexes. In JavaScript, this behavior is usually implemented using objects rather than traditional arrays.

View Mini Project

Date Objects

Date objects allow JavaScript programs to work with dates and times. They can be used to display the current time, calculate durations, or schedule events.

View Mini Project

Accessing Forms

JavaScript can access forms in a webpage to read user input. This makes it possible to collect data, process it, and respond dynamically.

View Mini Project

Accessing Form Elements

Individual form elements such as input fields, checkboxes, and buttons can be accessed using JavaScript to retrieve or modify user data.

View Mini Project

Simple Form Validation

Form validation ensures that users provide correct and complete information before submitting a form. This improves data quality and prevents errors.

View Mini Project

Form Validation

Advanced form validation checks multiple input conditions such as required fields, email format, password strength, and data ranges before allowing submission.

View Mini Project