𝟯 𝗙𝗥𝗘𝗘 𝗛𝘂𝗯𝗦𝗽𝗼𝘁 𝗖𝗲𝗿𝘁𝗶𝗳𝗶𝗰𝗮𝘁𝗶𝗼𝗻𝘀 𝗳𝗼𝗿 𝗦𝘁𝘂𝗱𝗲𝗻𝘁𝘀 & 𝗙𝗿𝗲𝘀𝗵𝗲𝗿𝘀 𝗶𝗻 𝟮𝟬𝟮𝟲🎓
💫HubSpot Academy offers three free online certifications that match these interests.
💫Pick one free course and try it out on your next college event and the certification is free.
🔗 𝗟𝗶𝗻𝗸 :- 👇
https://pdlink.in/4iM5xaQ
📲 *Save & Share with your friends! 🔥*
💫HubSpot Academy offers three free online certifications that match these interests.
💫Pick one free course and try it out on your next college event and the certification is free.
🔗 𝗟𝗶𝗻𝗸 :- 👇
https://pdlink.in/4iM5xaQ
📲 *Save & Share with your friends! 🔥*
❤2
𝗙𝗥𝗘𝗘 𝗥𝗲𝘀𝗼𝘂𝗿𝗰𝗲𝘀 𝗧𝗼 𝗚𝗲𝘁 𝗬𝗼𝘂𝗿 𝗗𝗿𝗲𝗮𝗺 𝗝𝗼𝗯 𝗜𝗡 𝗚𝗼𝗼𝗴𝗹𝗲🔥
Discover *4 FREE resources* to help you prepare for a career at Google!
✅ Improve Your Coding Skills
✅ Strengthen Interview Preparation
✅ Build Technical Knowledge
✅ Prepare for Top Tech Opportunities
🎓Perfect for Students, Freshers & Aspiring Software Engineers!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4AwRPQy
📲 SAVE & SHARE with friends dreaming of working at Google!
Discover *4 FREE resources* to help you prepare for a career at Google!
✅ Improve Your Coding Skills
✅ Strengthen Interview Preparation
✅ Build Technical Knowledge
✅ Prepare for Top Tech Opportunities
🎓Perfect for Students, Freshers & Aspiring Software Engineers!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4AwRPQy
📲 SAVE & SHARE with friends dreaming of working at Google!
❤1
𝗙𝗥𝗘𝗘 𝗩𝗜𝗥𝗧𝗨𝗔𝗟 𝗜𝗡𝗧𝗘𝗥𝗡𝗦𝗛𝗜𝗣𝗦 𝗪𝗜𝗧𝗛 𝗧𝗢𝗣 𝗖𝗢𝗠𝗣𝗔𝗡𝗜𝗘𝗦! 🎓
💻 Explore FREE Virtual Internship & Job Simulation Programs from leading companies!
✅ Learn Industry-Relevant Skills
✅ Work on Practical Tasks
✅ Self-Paced Online Learning
✅ Explore Completion Certificates
✅ Strengthen Your Resume & LinkedIn Profile
🎯 Perfect for Students, Freshers & Job Seekers
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4t8DRlq
📲 SAVE & SHARE with friends looking for career opportunities!
💻 Explore FREE Virtual Internship & Job Simulation Programs from leading companies!
✅ Learn Industry-Relevant Skills
✅ Work on Practical Tasks
✅ Self-Paced Online Learning
✅ Explore Completion Certificates
✅ Strengthen Your Resume & LinkedIn Profile
🎯 Perfect for Students, Freshers & Job Seekers
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4t8DRlq
📲 SAVE & SHARE with friends looking for career opportunities!
❤1
𝟰 𝗙𝗥𝗘𝗘 𝗖𝗼𝘂𝗿𝘀𝗲𝘀 𝗧𝗼 𝗠𝗮𝘀𝘁𝗲𝗿 𝗘𝘅𝗰𝗲𝗹 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘 📊
🎓 Explore 4 FREE Excel Courses to upgrade your skills!
✅ Excel Formulas & Functions
✅ Pivot Tables & Charts
✅ Data Cleaning & Analysis
✅ Dashboards & Reporting
🎯 Perfect for Students, Freshers & Aspiring Data Analysts!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/48mO4B2
📌 SAVE & SHARE with friends who want to master Excel! 🔥
🎓 Explore 4 FREE Excel Courses to upgrade your skills!
✅ Excel Formulas & Functions
✅ Pivot Tables & Charts
✅ Data Cleaning & Analysis
✅ Dashboards & Reporting
🎯 Perfect for Students, Freshers & Aspiring Data Analysts!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/48mO4B2
📌 SAVE & SHARE with friends who want to master Excel! 🔥
💻 JavaScript Learning Series - Day 6
Topic 6: Functions in JavaScript
Functions are one of the most important concepts in JavaScript.
A function is a reusable block of code designed to perform a specific task.
Instead of writing the same code repeatedly, you can create a function and execute it whenever needed.
For example:
• Calculate employee salaries.
• Validate user login details.
• Calculate shopping discounts.
• Process customer information.
• Perform mathematical calculations.
Let's understand functions step by step.
1. What Is a Function?
A function is a block of code that performs a particular task when called.
Output:
Explanation:
•
•
•
•
•
Important: Defining a function does not automatically execute it. You must call it.
2. Function Declaration
A function declaration defines a function using the
Syntax:
Example:
Output:
Function declarations can generally be called before their definition because they are hoisted.
3. Functions with Parameters
Parameters allow you to pass information into a function.
Output:
Here:
•
•
Difference:
Parameter ➜ Variable listed in the function definition.
Argument ➜ Actual value passed when calling the function.
4. Functions with Return Values
The
Output:
• The function receives two values.
• It adds them.
•
• The result is stored in the
Important:
5. Function Expression
A function expression stores a function inside a variable.
Output:
Unlike function declarations, function expressions assigned to variables cannot generally be called before their initialization.
6. Arrow Functions
Arrow functions provide a shorter syntax for writing functions.
They were introduced in ES6.
Traditional function:
Arrow function:
Output:
For a single expression, you can write:
Output:
Topic 6: Functions in JavaScript
Functions are one of the most important concepts in JavaScript.
A function is a reusable block of code designed to perform a specific task.
Instead of writing the same code repeatedly, you can create a function and execute it whenever needed.
For example:
• Calculate employee salaries.
• Validate user login details.
• Calculate shopping discounts.
• Process customer information.
• Perform mathematical calculations.
Let's understand functions step by step.
1. What Is a Function?
A function is a block of code that performs a particular task when called.
function greet() {
console.log("Hello, Welcome!");
}
greet();Output:
Hello, Welcome!
Explanation:
•
function ➜ Keyword used to declare a function.•
greet ➜ Function name.•
() ➜ Holds parameters, if required.•
{} ➜ Contains the function's code.•
greet() ➜ Calls or executes the function.Important: Defining a function does not automatically execute it. You must call it.
2. Function Declaration
A function declaration defines a function using the
function keyword.Syntax:
function functionName() {
// Code to execute
}Example:
function welcome() {
console.log("Welcome to JavaScript");
}
welcome();Output:
Welcome to JavaScript
Function declarations can generally be called before their definition because they are hoisted.
3. Functions with Parameters
Parameters allow you to pass information into a function.
function greet(name) {
console.log("Hello " + name);
}
greet("Rahul");
greet("Priya");Output:
Hello Rahul
Hello Priya
Here:
•
name is a parameter.•
"Rahul" and "Priya" are arguments.Difference:
Parameter ➜ Variable listed in the function definition.
Argument ➜ Actual value passed when calling the function.
4. Functions with Return Values
The
return statement sends a value back from a function.function add(a, b) {
return a + b;
}
let result = add(10, 20);
console.log(result);Output:
30
• The function receives two values.
• It adds them.
•
return sends the result back.• The result is stored in the
result variable.Important:
return also terminates the function's execution.5. Function Expression
A function expression stores a function inside a variable.
const greet = function() {
console.log("Hello JavaScript");
};
greet();Output:
Hello JavaScript
Unlike function declarations, function expressions assigned to variables cannot generally be called before their initialization.
6. Arrow Functions
Arrow functions provide a shorter syntax for writing functions.
They were introduced in ES6.
Traditional function:
function add(a, b) {
return a + b;
}Arrow function:
const add = (a, b) => {
return a + b;
};
console.log(add(10, 20));Output:
30
For a single expression, you can write:
const add = (a, b) => a + b;
console.log(add(5, 10));
Output:
15
❤4
Arrow functions are commonly used in modern JavaScript, callbacks, and array methods.
Note: Arrow functions do not have their own
7. Anonymous Functions
An anonymous function is a function without a name.
Output after approximately 2 seconds:
Anonymous functions are frequently used as callbacks.
8. Default Parameters
Default parameters provide fallback values when an argument is missing or
Output:
9. Rest Parameters
Rest parameters allow a function to accept multiple arguments and collect them into an array.
Output:
Here,
10. Callback Functions
A callback is a function passed as an argument to another function.
Output:
Callbacks are widely used in:
• Event handling.
• Asynchronous programming.
• Array methods.
• API operations.
11. Immediately Invoked Function Expression (IIFE)
An IIFE is a function that executes immediately after it is defined.
Output:
IIFEs were traditionally used to create private scopes and avoid polluting the global namespace.
12. Function Scope
Scope determines where a variable can be accessed.
JavaScript has different types of scope.
A. Global Scope
Variables declared outside functions and blocks may be accessible throughout their containing script or module environment.
B. Function Scope
Variables declared with
C. Block Scope
Variables declared using
13. Higher-Order Functions
A higher-order function is a function that accepts another function as an argument or returns a function.
Higher-order functions are widely used in functional programming and array operations.
14. Real-World Example: Employee Salary Calculator
Note: Arrow functions do not have their own
this binding.7. Anonymous Functions
An anonymous function is a function without a name.
setTimeout(function() {
console.log("Hello after 2 seconds");
}, 2000);Output after approximately 2 seconds:
Hello after 2 seconds
Anonymous functions are frequently used as callbacks.
8. Default Parameters
Default parameters provide fallback values when an argument is missing or
undefined.function greet(name = "Guest") {
console.log("Hello " + name);
}
greet("Rahul");
greet();Output:
Hello Rahul
Hello Guest
9. Rest Parameters
Rest parameters allow a function to accept multiple arguments and collect them into an array.
function calculateTotal(...numbers) {
let total = 0;
for (let num of numbers) {
total += num;
}
return total;
}
console.log(calculateTotal(10, 20, 30, 40));Output:
100
Here,
...numbers collects all the supplied arguments into one array.10. Callback Functions
A callback is a function passed as an argument to another function.
function greet(name, callback) {
console.log("Hello " + name);
callback();
}
function message() {
console.log("Welcome to JavaScript");
}
greet("Rahul", message);Output:
Hello Rahul
Welcome to JavaScript
Callbacks are widely used in:
• Event handling.
• Asynchronous programming.
• Array methods.
• API operations.
11. Immediately Invoked Function Expression (IIFE)
An IIFE is a function that executes immediately after it is defined.
(function() {
console.log("Function executed immediately");
})();Output:
Function executed immediately
IIFEs were traditionally used to create private scopes and avoid polluting the global namespace.
12. Function Scope
Scope determines where a variable can be accessed.
JavaScript has different types of scope.
A. Global Scope
Variables declared outside functions and blocks may be accessible throughout their containing script or module environment.
let name = "Rahul";
function greet() {
console.log(name);
}
B. Function Scope
Variables declared with
var inside a function are accessible within that function.function test() {
var age = 25;
console.log(age);
}
test();C. Block Scope
Variables declared using
let and const inside a block are accessible only within that block.if (true) {
let age = 25;
const city = "Delhi";
}
console.log(age); // ReferenceError13. Higher-Order Functions
A higher-order function is a function that accepts another function as an argument or returns a function.
function calculate(a, b, operation) {
return operation(a, b);
}
function add(x, y) {
return x + y;
}
console.log(calculate(10, 20, add));Higher-order functions are widely used in functional programming and array operations.
14. Real-World Example: Employee Salary Calculator
❤3
function calculateSalary(basicSalary, bonus) {
let totalSalary = basicSalary + bonus;
return totalSalary;
}
function displaySalary(name, salary) {
console.log("Employee:", name);
console.log("Total Salary:", salary);
}
let salary = calculateSalary(50000, 10000);
displaySalary("Rahul", salary);Output:
Employee: Rahul
Total Salary: 60000
This example demonstrates how functions help organize and reuse business logic.
15. Common Mistakes Beginners Should Avoid
• Forgetting to call a function after declaring it.
• Confusing parameters with arguments.
• Forgetting the
return statement.• Using variables outside their scope.
• Confusing arrow functions with regular functions.
• Passing incorrect arguments.
• Creating unnecessarily large functions.
• Forgetting that a function without an explicit return statement returns
undefined.16. Quick Revision: Types of Functions
🔹 Function Declaration ➜ Defines a function using the
function keyword.🔹 Function Expression ➜ Stores a function inside a variable.
🔹 Arrow Function ➜ Provides shorter function syntax.
🔹 Anonymous Function ➜ Function without a name.
🔹 Callback Function ➜ Function passed as an argument to another function.
🔹 IIFE ➜ Function that executes immediately after definition.
🔹 Higher-Order Function ➜ Accepts or returns another function.
🔹 Recursive Function ➜ A function that calls itself.
Key Takeaways
• Functions make code reusable and organized.
• Parameters allow functions to accept input.
• Return statements send results back.
• Arrow functions simplify function syntax.
• Callbacks allow functions to work with other functions.
• Scope determines variable accessibility.
• Higher-order functions are important in modern JavaScript.
Double Tap ❤️ For More
❤7
𝗠𝗜𝗖𝗥𝗢𝗦𝗢𝗙𝗧 𝗣𝗢𝗪𝗘𝗥 𝗕𝗜 – 𝗙𝗥𝗘𝗘 𝗖𝗢𝗨𝗥𝗦𝗘! 📊
😍 Want to master Power BI & Data Analytics without spending ₹1?
🎓 Explore Microsoft's FREE Power BI learning resources!
✅ Data Visualization & Dashboards
✅ Power Query & Data Cleaning
✅ DAX Formulas & Data Modeling
✅ Business Intelligence Skills
🎯 Perfect for Students, Freshers & Aspiring Data Analysts!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4t3Jl0E
📌 SAVE & SHARE with friends interested in Data Analytics! 🔥
😍 Want to master Power BI & Data Analytics without spending ₹1?
🎓 Explore Microsoft's FREE Power BI learning resources!
✅ Data Visualization & Dashboards
✅ Power Query & Data Cleaning
✅ DAX Formulas & Data Modeling
✅ Business Intelligence Skills
🎯 Perfect for Students, Freshers & Aspiring Data Analysts!
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4t3Jl0E
📌 SAVE & SHARE with friends interested in Data Analytics! 🔥
❤1
𝗧𝗢𝗣 𝟱 𝗣𝗟𝗔𝗧𝗙𝗢𝗥𝗠𝗦 𝗧𝗢 𝗙𝗜𝗡𝗗 𝗛𝗜𝗚𝗛-𝗣𝗔𝗬𝗜𝗡𝗚 𝗥𝗘𝗠𝗢𝗧𝗘 𝗧𝗘𝗖𝗛 𝗝𝗢𝗕𝗦!
Explore 5 platforms to discover remote opportunities in:
💻 Software Development
📊 Data Analytics
🤖 AI & Machine Learning
☁️ Cloud Computing
🔐 Cybersecurity
✅ Work-From-Home Opportunities
✅ Explore Global Tech Companies
✅ Find Jobs Matching Your Skills
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4C6fqci
📌 SAVE & SHARE with friends looking for remote jobs! 🔥
Explore 5 platforms to discover remote opportunities in:
💻 Software Development
📊 Data Analytics
🤖 AI & Machine Learning
☁️ Cloud Computing
🔐 Cybersecurity
✅ Work-From-Home Opportunities
✅ Explore Global Tech Companies
✅ Find Jobs Matching Your Skills
🔗 𝗟𝗶𝗻𝗸 👇:-
https://pdlink.in/4C6fqci
📌 SAVE & SHARE with friends looking for remote jobs! 🔥
❤1
𝗙𝗥𝗘𝗘 𝗢𝗻𝗹𝗶𝗻𝗲 𝗠𝗮𝘀𝘁𝗲𝗿𝗰𝗹𝗮𝘀𝘀 𝗢𝗻 𝗔𝗜 | 𝗕𝘂𝗶𝗹𝗱 𝗔𝗜-𝗡𝗮𝘁𝗶𝘃𝗲 𝗧𝗲𝗰𝗵 𝗖𝗮𝗿𝗲𝗲𝗿😍
- Get Exclusive 90-Day MAANG Career Roadmap
- Identify Which AI-Era Roles Companies Are Hiring For Now
🎓Eligibility :- Students ,Freshers & Working Professionals
𝗥𝗲𝗴𝗶𝘀𝘁𝗲𝗿 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇 :-
https://pdlink.in/4zQvjC2
Date:- 21st Nov 2026 Time:- 5:00 PM (IST)
- Get Exclusive 90-Day MAANG Career Roadmap
- Identify Which AI-Era Roles Companies Are Hiring For Now
🎓Eligibility :- Students ,Freshers & Working Professionals
𝗥𝗲𝗴𝗶𝘀𝘁𝗲𝗿 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇 :-
https://pdlink.in/4zQvjC2
Date:- 21st Nov 2026 Time:- 5:00 PM (IST)
💻 JavaScript Learning Series: Day 7
Topic 7: Arrays in JavaScript
Arrays are one of the most important concepts in JavaScript.
An array is a special type of object used to store multiple values in a single variable.
Instead of creating separate variables for every value, you can store them together in an array.
Example:
Without an array:
Using an array:
Output:
Let's understand arrays step by step.
1. Creating an Array
You can create an array using square brackets
JavaScript arrays can contain different data types.
You can also create an array using the Array constructor:
2. Accessing Array Elements
Array elements are accessed using their index positions.
Important: JavaScript arrays use zero-based indexing.
• First element ➜ Index 0
• Second element ➜ Index 1
• Third element ➜ Index 2
• Fourth element ➜ Index 3
Example:
Output:
3. Modifying Array Elements
You can change an array element by accessing its index.
Output:
The element at index 1 has been replaced.
4. Finding Array Length
The
Output:
You can also use it to access the last element:
Output:
5. Adding Elements to an Array
JavaScript provides several methods to add elements.
A. push()
Adds an element at the end of an array.
Output:
B. unshift()
Adds an element at the beginning of an array.
Output:
6. Removing Elements from an Array
A. pop()
Removes the last element.
Output:
B. shift()
Removes the first element.
Output:
7. Important Array Methods
Let's understand some commonly used array methods.
A. indexOf()
Returns the first index of a specified element, or -1 if it is not found.
Output:
B. includes()
Checks whether an array contains a particular element.
Output:
C. slice()
Returns a portion of an array without modifying the original array.
Topic 7: Arrays in JavaScript
Arrays are one of the most important concepts in JavaScript.
An array is a special type of object used to store multiple values in a single variable.
Instead of creating separate variables for every value, you can store them together in an array.
Example:
Without an array:
let fruit1 = "Apple";
let fruit2 = "Mango";
let fruit3 = "Banana";
Using an array:
let fruits = ["Apple", "Mango", "Banana"];
console.log(fruits);
Output:
["Apple", "Mango", "Banana"]
Let's understand arrays step by step.
1. Creating an Array
You can create an array using square brackets
[].let fruits = ["Apple", "Mango", "Banana"];
let numbers = [10, 20, 30, 40];
let mixed = ["Rahul", 25, true, 50000];
console.log(fruits);
console.log(numbers);
console.log(mixed);
JavaScript arrays can contain different data types.
You can also create an array using the Array constructor:
let numbers = new Array(10, 20, 30);
console.log(numbers);
2. Accessing Array Elements
Array elements are accessed using their index positions.
Important: JavaScript arrays use zero-based indexing.
• First element ➜ Index 0
• Second element ➜ Index 1
• Third element ➜ Index 2
• Fourth element ➜ Index 3
Example:
console.log(fruits[0]);
console.log(fruits[1]);
console.log(fruits[2]);
Output:
Apple
Mango
Banana
3. Modifying Array Elements
You can change an array element by accessing its index.
fruits[1] = "Orange";
console.log(fruits);
Output:
["Apple", "Orange", "Banana"]
The element at index 1 has been replaced.
4. Finding Array Length
The
length property returns the total number of elements in an array.console.log(fruits.length);
Output:
3You can also use it to access the last element:
let lastFruit = fruits[fruits.length - 1];
console.log(lastFruit);
Output:
Banana5. Adding Elements to an Array
JavaScript provides several methods to add elements.
A. push()
Adds an element at the end of an array.
let fruits = ["Apple", "Mango"];
fruits.push("Banana");
console.log(fruits);
Output:
["Apple", "Mango", "Banana"]B. unshift()
Adds an element at the beginning of an array.
fruits.unshift("Banana");
console.log(fruits);Output:
["Banana", "Apple", "Mango"]6. Removing Elements from an Array
A. pop()
Removes the last element.
fruits.pop();
console.log(fruits);
Output:
["Apple", "Mango"]B. shift()
Removes the first element.
fruits.shift();
console.log(fruits);
Output:
["Mango", "Banana"]7. Important Array Methods
Let's understand some commonly used array methods.
A. indexOf()
Returns the first index of a specified element, or -1 if it is not found.
console.log(fruits.indexOf("Mango"));Output:
1B. includes()
Checks whether an array contains a particular element.
console.log(fruits.includes("Mango"));Output:
trueC. slice()
Returns a portion of an array without modifying the original array.
❤1
let numbers = [10, 20, 30, 40, 50];
let result = numbers.slice(1, 4);
console.log(result);
Output:
[20, 30, 40]D. splice()
Adds, removes, or replaces elements in the original array.
fruits.splice(1, 1, "Orange");
console.log(fruits);
Output:
["Apple", "Orange", "Banana"]Here:
• 1 ➜ Starting index.
• 1 ➜ Number of elements to remove.
• "Orange" ➜ New element to insert.
8. Iterating Through Arrays
You can use loops to access every element in an array.
A. Using for Loop
for (let i = 0; i < fruits.length; i++) {
console.log(fruits[i]);
}B. Using for...of
for (let fruit of fruits) {
console.log(fruit);
}C. Using forEach()
Executes a callback function for each array element.
let numbers = [10, 20, 30];
numbers.forEach(function(num) {
console.log(num);
});
9. map() Method
The
map() method creates a new array by transforming every element of the original array.Example: Multiply Every Number by 2
let numbers = [1, 2, 3, 4, 5];
let result = numbers.map(num => num * 2);
console.log(result);
Output:
[2, 4, 6, 8, 10]
Use case: Transforming data, formatting values, and preparing information for display.
10. filter() Method
The
filter() method creates a new array containing elements that satisfy a given condition.Example: Find Even Numbers
let numbers = [1, 2, 3, 4, 5, 6];
let result = numbers.filter(num => num % 2 === 0);
console.log(result);
Output:
[2, 4, 6]
Use case: Filtering products, employees, customers, and records based on conditions.
11. reduce() Method
The
reduce() method processes array elements and combines them into a single accumulated result.Example: Calculate Total
let numbers = [10, 20, 30, 40];
let total = numbers.reduce((sum, num) => {
return sum + num;
}, 0);
console.log(total);
Output:
100Use case: Calculating totals, sums, averages, and aggregations.
12. find() Method
Returns the first element that satisfies a specified condition.
let numbers = [10, 20, 30, 40];
let result = numbers.find(num => num > 20);
console.log(result);
Output:
30Unlike
filter(), find() returns only the first matching element.13. sort() Method
Used to sort array elements.
let numbers = [40, 10, 30, 20];
numbers.sort((a, b) => a - b);
console.log(numbers);
Output:
[10, 20, 30, 40]For descending order:
numbers.sort((a, b) => b - a);
console.log(numbers);
Important: Calling
sort() directly without a comparator sorts elements as strings by default.14. Joining Array Elements
The
join() method combines array elements into a single string.let result = fruits.join(", ");
console.log(result);Output:
Apple, Mango, Banana
15. Multidimensional Arrays
A multidimensional array contains other arrays as elements.
let numbers = [
[1, 2, 3],
[4, 5, 6],
[7, 8, 9]
];
console.log(numbers[0][1]);
console.log(numbers[2][2]);
Output:
2
9
These arrays are useful for matrices, tables, grids, and structured datasets.
16. Arrays of Objects
In real-world applications, arrays frequently store multiple objects.
Example: Employee Records
Output:
You can also filter employees based on salary:
This is commonly used when working with API responses and business applications.
17. Real-World Example: Shopping Cart
Let's build a simple shopping cart using JavaScript arrays.
Output:
This example combines arrays, objects, and the
18. Important Array Methods, Quick Revision
🔹
🔹
🔹
🔹
🔹
🔹
🔹
🔹
🔹
🔹
🔹
🔹
🔹
🔹
🔹
Double Tap ❤️ For More
16. Arrays of Objects
In real-world applications, arrays frequently store multiple objects.
Example: Employee Records
let employees = [
{
name: "Rahul",
salary: 50000
},
{
name: "Priya",
salary: 60000
},
{
name: "Amit",
salary: 45000
}
];
console.log(employees[0].name);
console.log(employees[1].salary);
Output:
Rahul
60000
You can also filter employees based on salary:
let highSalary = employees.filter(
emp => emp.salary > 50000
);
console.log(highSalary);
This is commonly used when working with API responses and business applications.
17. Real-World Example: Shopping Cart
Let's build a simple shopping cart using JavaScript arrays.
let cart = [
{ name: "Laptop", price: 50000 },
{ name: "Mouse", price: 1000 },
{ name: "Keyboard", price: 2000 }
];
let total = cart.reduce((sum, item) => {
return sum + item.price;
}, 0);
console.log("Cart Items:", cart.length);
console.log("Total Amount:", total);
Output:
Cart Items: 3
Total Amount: 53000
This example combines arrays, objects, and the
reduce() method.18. Important Array Methods, Quick Revision
🔹
push() ➜ Adds an element at the end.🔹
pop() ➜ Removes the last element.🔹
shift() ➜ Removes the first element.🔹
unshift() ➜ Adds an element at the beginning.🔹
map() ➜ Transforms every element and returns a new array.🔹
filter() ➜ Returns elements matching a condition.🔹
reduce() ➜ Combines elements into a single result.🔹
forEach() ➜ Executes a function for every element.🔹
find() ➜ Returns the first matching element.🔹
includes() ➜ Checks whether an element exists.🔹
indexOf() ➜ Returns the first matching index.🔹
slice() ➜ Extracts a portion without modifying the original array.🔹
splice() ➜ Adds, removes, or replaces elements in the original array.🔹
sort() ➜ Sorts array elements.🔹
join() ➜ Converts array elements into a string. Double Tap ❤️ For More
❤1
𝗙𝗥𝗘𝗘 𝗟𝗘𝗔𝗥𝗡𝗜𝗡𝗚 𝗔𝗡𝗗 𝗖𝗘𝗥𝗧𝗜𝗙𝗜𝗖𝗔𝗧𝗜𝗢𝗡 𝗥𝗘𝗦𝗢𝗨𝗥𝗖𝗘𝗦 𝗧𝗢 𝗕𝗨𝗜𝗟𝗗 𝗬𝗢𝗨𝗥 𝗖𝗢𝗗𝗜𝗡𝗚 𝗦𝗞𝗜𝗟𝗟𝗦😍
Explore free courses and resources to learn:
✅ Beginner-Friendly Resources
✅ Self-Paced Learning
✅ Build Practical Coding Skills
✅ Explore Certification Opportunities
🎯 Perfect for Students, Freshers & Aspiring Developers!
𝗟𝗶𝗻𝗸👇:-
https://pdlink.in/4fbyA6I
📌 SAVE & SHARE with friends looking for FREE courses🔥
Explore free courses and resources to learn:
✅ Beginner-Friendly Resources
✅ Self-Paced Learning
✅ Build Practical Coding Skills
✅ Explore Certification Opportunities
🎯 Perfect for Students, Freshers & Aspiring Developers!
𝗟𝗶𝗻𝗸👇:-
https://pdlink.in/4fbyA6I
📌 SAVE & SHARE with friends looking for FREE courses🔥
🌐 Web Development Tips for Beginners
Starting web development can feel overwhelming because there are so many technologies to learn.
HTML, CSS, JavaScript, React, Node.js, databases, Git, APIs… 😵💫
The key is not to learn everything at once.
Here are some practical tips that can make your journey much easier 👇
1️⃣ Master the Basics Before Frameworks
Don't rush into React just because everyone is talking about it.
First understand:
HTML → Structure
CSS → Styling
JavaScript → Logic
Once these are clear, frameworks become much easier to understand.
2️⃣ Don't Just Watch Tutorials
Watching 100 hours of tutorials won't make you a developer.
After learning a concept, immediately build something with it.
For example:
Learn Forms
↓
Build a Registration Form
Learn DOM
↓
Build a To-Do List
Learn APIs
↓
Build a Weather App
👉 Learn → Build → Break → Fix → Repeat.
3️⃣ Learn by Building Small Projects
Don't start with:
❌ "I'll build the next Amazon."
Start with:
✔ Calculator
✔ To-Do App
✔ Quiz App
✔ Weather App
✔ Expense Tracker
✔ Notes App
✔ Portfolio Website
Small projects teach you how to actually solve problems.
4️⃣ Learn JavaScript Properly
JavaScript is one of the most important skills in modern web development.
Focus on:
Variables
Functions
Arrays
Objects
Loops
DOM
Events
Promises
Async/Await
Fetch API
ES6+
Modules
Error Handling
Don't just memorize syntax.
Understand why and when to use each concept.
5️⃣ Learn to Read Documentation
A professional developer doesn't Google every problem and copy the first answer.
Learn to use official documentation.
When you encounter a problem:
Understand the problem
↓
Search documentation
↓
Try a solution
↓
Test it
↓
Understand why it works
This skill becomes extremely valuable as you progress.
6️⃣ Get Comfortable With Developer Tools
Learn to use your browser's DevTools.
Important sections include:
Elements
Console
Network
Application
Sources
For example, if an API isn't working, the Network tab can help you inspect:
Request
Response
Status code
Headers
Payload
7️⃣ Learn Git Early
Don't wait until you're applying for jobs.
Learn basic Git commands:
git init
git add .
git commit -m "Initial commit"
git status
git push
git pull
Use GitHub to maintain your projects.
Your GitHub profile can become part of your developer portfolio.
8️⃣ Understand How Websites Actually Work
Don't just learn code.
Understand the fundamentals:
Browser
↓
HTTP Request
↓
Server
↓
Database
↓
Server Response
↓
Browser
Learn the basics of:
HTTP
URLs
DNS
APIs
JSON
Status codes
Client vs Server
Databases
This knowledge makes full-stack development much easier.
9️⃣ Don't Copy-Paste Code You Don't Understand
You can use AI tools and online resources.
But avoid blindly copying code.
If you get:
fetch("/api/users")
understand:
What is fetch()?
What is an API?
What does /api/users represent?
What does the response contain?
What happens if the request fails?
Understanding matters more than typing.
🔟 Learn Debugging
Errors are not failures.
They are clues.
When you see:
404
500
TypeError
SyntaxError
undefined
Don't immediately delete your code.
Read the error.
Ask:
What happened?
Starting web development can feel overwhelming because there are so many technologies to learn.
HTML, CSS, JavaScript, React, Node.js, databases, Git, APIs… 😵💫
The key is not to learn everything at once.
Here are some practical tips that can make your journey much easier 👇
1️⃣ Master the Basics Before Frameworks
Don't rush into React just because everyone is talking about it.
First understand:
HTML → Structure
CSS → Styling
JavaScript → Logic
Once these are clear, frameworks become much easier to understand.
2️⃣ Don't Just Watch Tutorials
Watching 100 hours of tutorials won't make you a developer.
After learning a concept, immediately build something with it.
For example:
Learn Forms
↓
Build a Registration Form
Learn DOM
↓
Build a To-Do List
Learn APIs
↓
Build a Weather App
👉 Learn → Build → Break → Fix → Repeat.
3️⃣ Learn by Building Small Projects
Don't start with:
❌ "I'll build the next Amazon."
Start with:
✔ Calculator
✔ To-Do App
✔ Quiz App
✔ Weather App
✔ Expense Tracker
✔ Notes App
✔ Portfolio Website
Small projects teach you how to actually solve problems.
4️⃣ Learn JavaScript Properly
JavaScript is one of the most important skills in modern web development.
Focus on:
Variables
Functions
Arrays
Objects
Loops
DOM
Events
Promises
Async/Await
Fetch API
ES6+
Modules
Error Handling
Don't just memorize syntax.
Understand why and when to use each concept.
5️⃣ Learn to Read Documentation
A professional developer doesn't Google every problem and copy the first answer.
Learn to use official documentation.
When you encounter a problem:
Understand the problem
↓
Search documentation
↓
Try a solution
↓
Test it
↓
Understand why it works
This skill becomes extremely valuable as you progress.
6️⃣ Get Comfortable With Developer Tools
Learn to use your browser's DevTools.
Important sections include:
Elements
Console
Network
Application
Sources
For example, if an API isn't working, the Network tab can help you inspect:
Request
Response
Status code
Headers
Payload
7️⃣ Learn Git Early
Don't wait until you're applying for jobs.
Learn basic Git commands:
git init
git add .
git commit -m "Initial commit"
git status
git push
git pull
Use GitHub to maintain your projects.
Your GitHub profile can become part of your developer portfolio.
8️⃣ Understand How Websites Actually Work
Don't just learn code.
Understand the fundamentals:
Browser
↓
HTTP Request
↓
Server
↓
Database
↓
Server Response
↓
Browser
Learn the basics of:
HTTP
URLs
DNS
APIs
JSON
Status codes
Client vs Server
Databases
This knowledge makes full-stack development much easier.
9️⃣ Don't Copy-Paste Code You Don't Understand
You can use AI tools and online resources.
But avoid blindly copying code.
If you get:
fetch("/api/users")
understand:
What is fetch()?
What is an API?
What does /api/users represent?
What does the response contain?
What happens if the request fails?
Understanding matters more than typing.
🔟 Learn Debugging
Errors are not failures.
They are clues.
When you see:
404
500
TypeError
SyntaxError
undefined
Don't immediately delete your code.
Read the error.
Ask:
What happened?
❤3👍1
Where did it happen?
Why did it happen?
How can I reproduce it?
How can I fix it?
Debugging is one of the most important developer skills.
1️⃣1️⃣ Make Your Projects Responsive
A website shouldn't look good only on your laptop.
Test it on:
📱 Mobile
📱 Tablet
💻 Laptop
🖥️ Desktop
Learn:
Flexbox
CSS Grid
Media Queries
Responsive Units
1️⃣2️⃣ Build Projects Without Following Tutorials
Tutorial projects are useful initially.
But eventually, close the tutorial and build something yourself.
For example:
Tutorial:
Build a To-Do App
Your Version:
Build an Expense Tracker
This forces you to think instead of follow instructions.
1️⃣3️⃣ Deploy Your Projects
A project sitting only on your laptop doesn't demonstrate deployment skills.
Learn how to deploy your applications.
For example:
Code
↓
GitHub
↓
Deployment Platform
↓
Live Website 🌐
Add the live link to your portfolio.
1️⃣4️⃣ Don't Learn Too Many Technologies at Once
Avoid this:
HTML
CSS
JavaScript
React
Angular
Vue
Node
Django
Java
Python
PHP
MongoDB
AWS
Docker
Kubernetes
😵💫
Instead:
HTML
↓
CSS
↓
JavaScript
↓
React
↓
Node.js
↓
Database
↓
Deployment
Build a strong foundation before expanding.
1️⃣5️⃣ Create a Portfolio
Your portfolio should show:
About
Skills
Projects
GitHub
Live Projects
Contact
For every major project, explain:
• What problem it solves
• Technologies used
• Key features
• Challenges faced
• What you learned
• Live demo
• GitHub repository
🧠 Don't compare your Day 10 with someone's Year 5.
You will:
Get confused
↓
Make mistakes
↓
Get stuck
↓
Debug
↓
Understand
↓
Improve
That's normal.
Every developer goes through this process.
🚀 Double Tap ❤️ For More
Why did it happen?
How can I reproduce it?
How can I fix it?
Debugging is one of the most important developer skills.
1️⃣1️⃣ Make Your Projects Responsive
A website shouldn't look good only on your laptop.
Test it on:
📱 Mobile
📱 Tablet
💻 Laptop
🖥️ Desktop
Learn:
Flexbox
CSS Grid
Media Queries
Responsive Units
1️⃣2️⃣ Build Projects Without Following Tutorials
Tutorial projects are useful initially.
But eventually, close the tutorial and build something yourself.
For example:
Tutorial:
Build a To-Do App
Your Version:
Build an Expense Tracker
This forces you to think instead of follow instructions.
1️⃣3️⃣ Deploy Your Projects
A project sitting only on your laptop doesn't demonstrate deployment skills.
Learn how to deploy your applications.
For example:
Code
↓
GitHub
↓
Deployment Platform
↓
Live Website 🌐
Add the live link to your portfolio.
1️⃣4️⃣ Don't Learn Too Many Technologies at Once
Avoid this:
HTML
CSS
JavaScript
React
Angular
Vue
Node
Django
Java
Python
PHP
MongoDB
AWS
Docker
Kubernetes
😵💫
Instead:
HTML
↓
CSS
↓
JavaScript
↓
React
↓
Node.js
↓
Database
↓
Deployment
Build a strong foundation before expanding.
1️⃣5️⃣ Create a Portfolio
Your portfolio should show:
About
Skills
Projects
GitHub
Live Projects
Contact
For every major project, explain:
• What problem it solves
• Technologies used
• Key features
• Challenges faced
• What you learned
• Live demo
• GitHub repository
🧠 Don't compare your Day 10 with someone's Year 5.
You will:
Get confused
↓
Make mistakes
↓
Get stuck
↓
Debug
↓
Understand
↓
Improve
That's normal.
Every developer goes through this process.
🚀 Double Tap ❤️ For More
❤13
𝗙𝗥𝗘𝗘 𝗠𝗮𝘀𝘁𝗲𝗿𝗰𝗹𝗮𝘀𝘀 𝗢𝗻 𝗟𝗮𝘁𝗲𝘀𝘁 𝗧𝗲𝗰𝗵𝗻𝗼𝗹𝗼𝗴𝗶𝗲𝘀 😍
Get the 90-Day Plan to Build 1% Tech Career
- AI
- GenAI
- Data Analytics
- Fullstack
- UI/UX
Use Coupon Code " 𝗛𝗖𝗟𝗚𝗨𝗩𝗜𝟭𝟬𝟬 " To Register For FREE
𝗥𝗲𝗴𝗶𝘀𝘁𝗲𝗿 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇 :-
https://pdlink.in/4fFMe22
Date:- 21st Nov 2026 Time:- 5:00 PM (IST)
Get the 90-Day Plan to Build 1% Tech Career
- AI
- GenAI
- Data Analytics
- Fullstack
- UI/UX
Use Coupon Code " 𝗛𝗖𝗟𝗚𝗨𝗩𝗜𝟭𝟬𝟬 " To Register For FREE
𝗥𝗲𝗴𝗶𝘀𝘁𝗲𝗿 𝗙𝗼𝗿 𝗙𝗥𝗘𝗘👇 :-
https://pdlink.in/4fFMe22
Date:- 21st Nov 2026 Time:- 5:00 PM (IST)
𝗕𝗢𝗢𝗦𝗧 𝗬𝗢𝗨𝗥 𝗥𝗘𝗦𝗨𝗠𝗘 𝗪𝗜𝗧𝗛 𝟰 𝗙𝗥𝗘𝗘 𝗜𝗡-𝗗𝗘𝗠𝗔𝗡𝗗 𝗖𝗢𝗨𝗥𝗦𝗘𝗦! 🎓
😍 Want to learn high-demand tech skills without spending ₹1?
📊 Data Analytics
💻 Full Stack Development
🤖 AI & Generative AI
☁️ Cloud Computing
🎯Perfect for Students, Freshers & Job Seekers!
𝗟𝗶𝗻𝗸👇:-
https://pdlink.in/4jsqetS
📌 SAVE & SHARE with friends looking for FREE courses🔥
😍 Want to learn high-demand tech skills without spending ₹1?
📊 Data Analytics
💻 Full Stack Development
🤖 AI & Generative AI
☁️ Cloud Computing
🎯Perfect for Students, Freshers & Job Seekers!
𝗟𝗶𝗻𝗸👇:-
https://pdlink.in/4jsqetS
📌 SAVE & SHARE with friends looking for FREE courses🔥
𝗖𝗜𝗦𝗖𝗢 𝗙𝗥𝗘𝗘 𝗖𝗢𝗨𝗥𝗦𝗘𝗦 𝟮𝟬𝟮𝟲! 🎓
Boost your Resume & LinkedIn Profile with valuable tech skills
Explore FREE Cisco learning resources! 🚀
🌐 Networking Fundamentals
🔐 Cybersecurity
☁️ Cloud & DevOps
💻 IT Fundamentals
🎯 Perfect for Students, Freshers & Job Seekers!
𝗟𝗶𝗻𝗸👇:-
https://pdlink.in/3WPl0Qg
📌 SAVE & SHARE with friends interested in Tech Careers! 🔥
Boost your Resume & LinkedIn Profile with valuable tech skills
Explore FREE Cisco learning resources! 🚀
🌐 Networking Fundamentals
🔐 Cybersecurity
☁️ Cloud & DevOps
💻 IT Fundamentals
🎯 Perfect for Students, Freshers & Job Seekers!
𝗟𝗶𝗻𝗸👇:-
https://pdlink.in/3WPl0Qg
📌 SAVE & SHARE with friends interested in Tech Careers! 🔥
❤1