Web Development - HTML, CSS & JavaScript
55.7K subscribers
1.9K photos
5 videos
34 files
517 links
Learn to code and become a Web Developer with HTML, CSS, JavaScript , Reactjs, Wordpress, PHP, Mern & Nodejs knowledge

Managed by: @love_data
Download Telegram
๐Ÿ”น Escape Characters

2๏ธโƒฃ5๏ธโƒฃ New Line

You can use \n and \t:

const message1 = "Hello\nWorld";
console.log(message1);
// Hello
// World

const message2 = "Name:\tRahul";
console.log(message2); // Name: Rahul (with tab)


๐Ÿ”น Comparing Strings

2๏ธโƒฃ6๏ธโƒฃ String Comparison

Strings can be compared:

console.log("apple" === "apple"); // true
console.log("Apple" === "apple"); // false - case-sensitive

const input = "ADMIN";
if (input.toLowerCase() === "admin") {
console.log("Access granted");
}


โญ Practical String Processing

Imagine a user enters an email:

const input = " USER@GMAIL.COM ";
const email = input.trim().toLowerCase();
console.log(email); // user@gmail.com

if (email.includes("@")) {
console.log("Email looks valid");
}


This combines:

โ€ข trim() โ†“ toLowerCase() โ†“ includes()

๐Ÿง  Real-World Example

Suppose you receive this data:

const data = "Amit, Priya, Rahul, Neha";
const names = data.split(",");
const cleanedNames = names.map(name => name.trim());

console.log(cleanedNames); // ["Amit", "Priya", "Rahul", "Neha"]

const filteredNames = cleanedNames.filter(
name => name.startsWith("R")
);

console.log(filteredNames); // ["Rahul"]


โš ๏ธ Common Beginner Mistakes

โ€ข Mistake 1: Forgetting that strings are zero-indexed

const word = "Hello";
console.log(word[0]); // H not e


โ€ข Mistake 2: Expecting string methods to modify the original string

const name = "rahul";
name.toUpperCase();
console.log(name); // still "rahul"

const upperName = name.toUpperCase(); // correct


โ€ข

Mistake 3: Forgetting trim()

โ€ข User input often has accidental spaces: " Rahul "

โ€ข

Mistake 4: Confusing split() and join()

โ€ข split() โ†’ string โ†’ array

โ€ข join() โ†’ array โ†’ string

๐Ÿ’ป Practice

โ€ข

1๏ธโƒฃ Reverse a String: Given const word = "JavaScript"; Try to produce tpircSavaJ. Hint: split() + reverse() + join()

โ€ข

2๏ธโƒฃ Count Characters: Count characters in "JavaScript"

โ€ข

3๏ธโƒฃ Convert to Uppercase: Convert "javascript is powerful" to uppercase.

โ€ข

4๏ธโƒฃ Extract Text: From "JavaScript" extract Script

โ€ข

5๏ธโƒฃ Replace Text: Convert "I love Python" into "I love JavaScript"

โ€ข

6๏ธโƒฃ Clean User Input: Given const input = " HELLO JAVASCRIPT "; Produce hello javascript

โ€ข

7๏ธโƒฃ Challenge: Given const email = " USER@EXAMPLE.COM ";

Create a cleaned version that:

- Removes extra spaces

- Converts everything to lowercase

- Checks whether it contains @

- Prints "Valid email format" if it does.

๐Ÿง  Double Tap โค๏ธ For More
โค7
10 Websites Every Developer & AI Enthusiast Should Bookmark

โœ… roadmap.sh โ€“ Step-by-step learning paths for devs
โœ… paperswithcode.com โ€“ Browse ML research with code implementations
โœ… devdocs.io โ€“ Offline access to all developer documentation
โœ… excalidraw.com โ€“ Create whiteboard-style diagrams for planning
โœ… codewars.com โ€“ Improve coding skills with challenges
โœ… vectara.com โ€“ Build RAG apps with AI-powered search
โœ… openai.com/blog โ€“ Stay updated with the latest AI research
โœ… learnprompting.org โ€“ Master the art of prompt engineering
โœ… hackertarget.com โ€“ Useful for cybersecurity testing tools

If you want more free resources like this React with emoji and turn all notification ๐Ÿ“ข

Join @free4unow_backup for more free resources.

ENJOY LEARNING ๐Ÿ‘๐Ÿ‘
โค10๐Ÿ”ฅ4๐Ÿ‘2
To learn web design and development from basic to advanced levels, you can follow these steps: ๐Ÿคฉ๐Ÿคฉ

โฉ HTML and CSS:

Start with the basics of HTML (Hypertext Markup Language) and CSS (Cascading Style Sheets). HTML provides the structure and content of web pages, while CSS handles the visual presentation. Learn how to create web pages, format text, add images, and apply styles using HTML and CSS.

โฉ JavaScript:

Expand your knowledge by learning JavaScript, a programming language for web development. JavaScript adds interactivity and dynamic features to websites. Study JavaScript concepts like variables, functions, loops, and conditional statements. Learn how to manipulate the Document Object Model (DOM) and create interactive elements.

โฉ Responsive Web Design:

Understand the principles of responsive web design, which ensures websites adapt to different screen sizes and devices. Learn techniques such as media queries and flexible layouts to create responsive and mobile-friendly websites.

โฉ Front-End Frameworks:

Explore popular front-end frameworks like Bootstrap or Foundation. These frameworks provide pre-built components and a responsive grid system, making it easier to design and develop modern, visually appealing websites.

โฉ Back-End Development:

Dive into back-end development to create dynamic websites and handle server-side operations. Learn a back-end programming language such as Python, PHP, or Node.js. Understand concepts like server-side scripting, handling databases, and interacting with APIs.

โฉ Database Management:

Gain knowledge of database management systems such as MySQL or PostgreSQL. Understand how to create, manage, and query databases, as well as the principles of database design and normalization.

โฉ Content Management Systems (CMS):

Explore popular CMS platforms like WordPress, Joomla, or Drupal. Learn how to customize and develop themes, create plugins or modules, and manage website content using CMS tools.

โฉ Version Control:

Familiarize yourself with version control systems like Git. Learn how to track changes, collaborate with others, and manage your codebase effectively using version control.

โฉ Web Performance and Optimization:

Study techniques for optimizing website performance, such as optimizing images, minifying CSS and JavaScript files, and caching. Understand concepts like page speed, performance testing, and website optimization best practices.

โฉ Continuous Learning and Industry Trends:

Stay updated with the latest web design and development trends, technologies, and tools. Follow blogs, forums, and online communities to learn from industry experts and explore new advancements.

โžก๏ธ Build Projects and Practice:

Put your knowledge into practice by building projects and websites. Start with small projects and gradually work on more complex ones. Building real-world projects will help you gain practical experience and refine your skills.

Web design and development is a vast field, and continuous learning is key. Practice regularly, experiment with different techniques, and don't be afraid to take on challenges.

React โค๏ธ for more
โค19
DSA Handwritten Notes
โค9๐Ÿ‘4
๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ฃ๐—ผ๐˜„๐—ฒ๐—ฟ ๐—•๐—œ ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜! ๐Ÿ”ฅ

Learn Power BI through these FREE learning resources
โ€‹
โœจ What You'll Learn:
๐Ÿ“Š Interactive Dashboards
๐Ÿ“ˆ Data Visualization
๐Ÿงน Data Transformation
๐Ÿ’ผ Real-World Reporting Skills
๐ŸŽฏ Beginner-Friendly โ€” No Coding Required

๐—ฆ๐˜๐—ฎ๐—ฟ๐˜ ๐—Ÿ๐—ฒ๐—ฎ๐—ฟ๐—ป๐—ถ๐—ป๐—ด ๐—ณ๐—ผ๐—ฟ ๐—™๐—ฅ๐—˜๐—˜
โ€‹
โ€‹https://pdlink.in/4hznwlu

๐Ÿ’ซPerfect for Students โ€ข Freshers โ€ข Data Analyst Aspirants โ€ข Working Professionals
โค5
๐Ÿš€๐—ฃ๐—ฎ๐˜† ๐—”๐—ณ๐˜๐—ฒ๐—ฟ ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—ง๐—ฟ๐—ฎ๐—ถ๐—ป๐—ถ๐—ป๐—ด | ๐—•๐—ฒ๐—ฐ๐—ผ๐—บ๐—ฒ ๐—ฎ ๐—™๐˜‚๐—น๐—น๐˜€๐˜๐—ฎ๐—ฐ๐—ธ ๐——๐—ฒ๐˜ƒ๐—ฒ๐—น๐—ผ๐—ฝ๐—ฒ๐—ฟ ๐—ช๐—œ๐˜๐—ต ๐—š๐—ฒ๐—ป๐—”๐—œ

Start a high-paying tech careerโ€”even without prior coding experience

๐Ÿ† ๐—ฃ๐—น๐—ฎ๐—ฐ๐—ฒ๐—บ๐—ฒ๐—ป๐˜ ๐—›๐—ถ๐—ด๐—ต๐—น๐—ถ๐—ด๐—ต๐˜๐˜€:
๐Ÿ’ฐ โ‚น41 LPA highest salary
๐Ÿ“ˆ โ‚น7.4 LPA average salary
๐ŸŽ“ 2,000+ students placed
๐Ÿข 500+ hiring partners
โœ… 100% job assistance
๐Ÿ“œ Skill Indiaโ€“authenticated certificate

๐Ÿ”— ๐—”๐—ฝ๐—ฝ๐—น๐˜† ๐—ก๐—ผ๐˜„๐Ÿ‘‡:-

https://pdlink.in/3SuUeuD

๐ŸŽฏ HurryUp.....Limited Seats Available
โค2
๐ŸŽ“ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐˜„๐—ถ๐˜๐—ต ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ฒ๐˜€! ๐Ÿš€๐Ÿ”ฅ

Upgrade your resume with Microsoft learning opportunities. Explore courses covering some of today's most in-demand tech skills!

๐ŸŽฏ Perfect for Students โ€ข Freshers โ€ข Job Seekers โ€ข Working Professionals

โœ… Learn at your own pace โœ… Build career-relevant skills โœ… Explore available certificates and credentials

๐Ÿ”— ๐—”๐—ฐ๐—ฐ๐—ฒ๐˜€๐˜€ ๐— ๐—ถ๐—ฐ๐—ฟ๐—ผ๐˜€๐—ผ๐—ณ๐˜ ๐—–๐—ผ๐˜‚๐—ฟ๐˜€๐—ฒ๐˜€ ๐—›๐—ฒ๐—ฟ๐—ฒ ๐Ÿ‘‡

https://pdlink.in/3Uf5trR

๐Ÿ”ฅ Share with friends looking to upskill in 2026!
โค1
๐Ÿ‡ฎ๐Ÿ‡ณ ๐—š๐—ข๐—ฉ๐—˜๐—ฅ๐—ก๐— ๐—˜๐—ก๐—ง ๐—ข๐—™ ๐—œ๐—ก๐——๐—œ๐—” โ€” ๐—”๐—œ๐—–๐—ง๐—˜ ๐—œ๐—ก๐—ง๐—˜๐—ฅ๐—ก๐—ฆ๐—›๐—œ๐—ฃ๐—ฆ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ ๐Ÿš€

Students and freshers can explore internship opportunities through the AICTE Internship Portal across multiple domains:

๐Ÿ’ป AI, Data Science & Web Development
๐Ÿ“ˆ Digital Marketing & Business Development
๐Ÿ’ฐ Finance & Accounting
โœ๏ธ Content Writing & Graphic Design
โš™๏ธ Mechanical, Civil & Electrical Engineering

๐Ÿ”— ๐—–๐—ต๐—ฒ๐—ฐ๐—ธ ๐—ข๐—ฝ๐—ฝ๐—ผ๐—ฟ๐˜๐˜‚๐—ป๐—ถ๐˜๐—ถ๐—ฒ๐˜€ & ๐—”๐—ฝ๐—ฝ๐—น๐˜† ๐Ÿ‘‡

https://pdlink.in/4y3vcBl

๐Ÿ“ข Share this opportunity with your friends and classmates!
โค3๐Ÿ‘2
๐Ÿš€ ๐—ช๐—ต๐—ถ๐—ฐ๐—ต ๐—ง๐—ฒ๐—ฐ๐—ต ๐—ฆ๐—ธ๐—ถ๐—น๐—น ๐—ช๐—ถ๐—น๐—น ๐—ฌ๐—ผ๐˜‚ ๐— ๐—ฎ๐˜€๐˜๐—ฒ๐—ฟ ๐—ถ๐—ป ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ?

Want to build apps, uncover insights, or create AI solutions? Explore certification courses that match your career goals! ๐ŸŽฏ

๐Ÿ’ป ๐—™๐˜‚๐—น๐—น ๐—ฆ๐˜๐—ฎ๐—ฐ๐—ธ ๐——๐—ฒ๐˜ƒ๐—ฒ๐—น๐—ผ๐—ฝ๐—บ๐—ฒ๐—ป๐˜
๐Ÿ‘‰ https://pdlink.in/3SuUeuD

๐Ÿ“Š ๐——๐—ฎ๐˜๐—ฎ ๐—”๐—ป๐—ฎ๐—น๐˜†๐˜๐—ถ๐—ฐ๐˜€
๐Ÿ‘‰ https://pdlink.in/45vk5ph

๐Ÿ’ซ๐—”๐—œ ๐—˜๐—ป๐—ด๐—ถ๐—ป๐—ฒ๐—ฒ๐—ฟ๐—ถ๐—ป๐—ด
๐Ÿ‘‰ https://pdlink.in/4fWJVID

๐Ÿ”ฅ Choose your path, sharpen your skills, and take the next step towards your tech career!

๐Ÿ“Œ Save this post & share it with a friend planning to upskill.
โค1
๐Ÿ’ป JavaScript Roadmap 2026 โ€” Part 9

๐ŸŸก Scope, Hoisting & Execution Context

Now we're moving from basic JavaScript syntax into concepts that explain how JavaScript actually executes your code.

These concepts are extremely important because they explain things like:

โ€ข Why some variables are accessible in certain places but not others

โ€ข Why functions can sometimes be called before they are written

โ€ข Why "let" and "const" behave differently from "var"

โ€ข How JavaScript manages function calls

โ€ข How nested functions access variables from outer functions

1๏ธโƒฃ What Is Scope?

Scope determines where a variable can be accessed in your program.

For example:

let name = "Rahul";

console.log(name);


The variable "name" is accessible here because it was declared in the outer scope.

But:

function greet() {
let message = "Hello";

console.log(message);
}

greet();


"message" is available inside "greet()".

Trying to access it outside:

console.log(message);


causes an error because "message" belongs to the function's local scope.

2๏ธโƒฃ Global Scope

A variable declared outside functions and blocks is generally in the global/module scope depending on how your JavaScript is executed.

Example:

const appName = "My App";

function showAppName() {
console.log(appName);
}

showAppName();


Output:

My App


The function can access "appName" because the variable exists in an outer scope.

3๏ธโƒฃ Function Scope

Variables declared inside a function are accessible within that function.

function calculate() {
const price = 1000;

console.log(price);
}

calculate();


This works.

But:

console.log(price);


doesn't work because "price" exists only inside "calculate()".

4๏ธโƒฃ Block Scope

A block is code surrounded by "{}".

For example:

if (true) {
let message = "Hello";

console.log(message);
}


"message" exists inside that block.

But:

console.log(message);


causes an error.

Variables declared using:

โ€ข let

โ€ข const

are block-scoped.

5๏ธโƒฃ "var" and Block Scope

This is one reason "var" can cause confusing behavior.

if (true) {
var message = "Hello";
}

console.log(message);


This can print:

Hello


because "var" is not block-scoped.

Compare:

if (true) {
let message = "Hello";
}

console.log(message);


This causes an error because "let" is block-scoped.

Remember:

โ€ข var โ†’ function-scoped

โ€ข let โ†’ block-scoped

โ€ข const โ†’ block-scoped

6๏ธโƒฃ Lexical Scope

JavaScript uses lexical scoping.

This means the scope of a variable is determined by where the code is written, not where the function is eventually called.

Example:

const name = "Rahul";

function outer() {

function inner() {
console.log(name);
}

inner();
}

outer();


"inner()" can access "name" because "name" exists in an outer lexical scope.

7๏ธโƒฃ Scope Chain

What happens if JavaScript can't find a variable in the current scope?

It looks outward.

Example:

const country = "India";

function outer() {

const city = "Pune";

function inner() {

const name = "Rahul";

console.log(name);
console.log(city);
console.log(country);
}

inner();
}

outer();
โค1
When "inner()" looks for:

name

it finds it in its own scope.

For:

city

JavaScript looks in the outer scope.

For:

country

it goes one level further outward.

Conceptually:

inner scope
โ†“
outer scope
โ†“
global/module scope


This is the scope chain.

8๏ธโƒฃ What Is Hoisting?

Hoisting describes how JavaScript's execution process makes certain declarations available before their position in the source code is reached.

But different declarations behave differently.

This is why you should avoid thinking of hoisting as simply:

"JavaScript moves all code to the top."

That's not an accurate mental model.

9๏ธโƒฃ Function Declaration Hoisting

Function declarations can be called before their declaration in the same scope.

greet();

function greet() {
console.log("Hello");
}


Output:

Hello


The function declaration is available when execution begins.

๐Ÿ”Ÿ "var" Hoisting

Consider:

console.log(age);

var age = 25;


The result is:

undefined


Conceptually, you can think of the declaration being initialized early:

var age;

console.log(age);

age = 25;


The important point is:

var declaration โ†’ initialized as undefined

before normal execution reaches the assignment.

1๏ธโƒฃ1๏ธโƒฃ "let" and "const" Hoisting

Now consider:

console.log(age);

let age = 25;


This produces a ReferenceError.

The same applies to:

console.log(age);

const age = 25;


Why?

"let" and "const" declarations are created during the setup phase, but they aren't initialized until execution reaches their declaration.

The period between entering the scope and initialization is called the:

Temporal Dead Zone (TDZ)

1๏ธโƒฃ2๏ธโƒฃ Temporal Dead Zone

Example:

{
console.log(name);

let name = "Rahul";
}


The variable "name" exists in the scope, but accessing it before initialization causes an error.

Conceptually:

Block begins
โ†“
name exists but is uninitialized
โ†“
Temporal Dead Zone
โ†“
let name = "Rahul"
โ†“
name becomes initialized


So:

console.log(name);
let name = "Rahul";


is not equivalent to using "var".

1๏ธโƒฃ3๏ธโƒฃ Why "let" and "const" Are Safer

Compare:

console.log(value);

var value = 10;


Output:

undefined


versus:

console.log(value);

let value = 10;


Error:

ReferenceError


The error makes the problem much easier to detect instead of silently giving you undefined.

1๏ธโƒฃ4๏ธโƒฃ Function Scope vs Block Scope Example

Consider:

function test() {

if (true) {
let a = 10;
var b = 20;
}

console.log(b);
}

test();


This works because "b" is function-scoped.

But:

function test() {

if (true) {
let a = 10;
}

console.log(a);
}
doesn't work because "a" is block-scoped.

โญ 1๏ธโƒฃ5๏ธโƒฃ What Is an Execution Context?

When JavaScript runs code, it creates an execution context.

An execution context is the environment in which JavaScript evaluates and executes code.

At a high level, there are different kinds of execution contexts.

The most important ones initially are:

โ€ข Global Execution Context: Created when your JavaScript program begins executing.

โ€ข Function Execution Context: Created whenever a function is called.

For example:

const name = "Rahul";

function greet() {
const message = "Hello";
console.log(message);
}

greet();


Conceptually:

Global Execution Context
โ†“
greet() called
โ†“
Function Execution Context


1๏ธโƒฃ6๏ธโƒฃ Creation Phase and Execution Phase

A simplified mental model is that JavaScript prepares an execution context before executing its statements.

During setup, JavaScript determines things such as:

โ€ข Variable bindings

โ€ข Function declarations

โ€ข Lexical environments

Then JavaScript executes the code.

For example:

var age = 25;

function greet() {
console.log("Hello");
}


During the setup process, JavaScript prepares the relevant bindings.

Then execution proceeds through the statements.

This helps explain why function declarations and "var" behave differently from "let" and "const".

1๏ธโƒฃ7๏ธโƒฃ Execution Context Stack

JavaScript uses a call stack to keep track of active function execution.

Example:

function first() {
second();
}

function second() {
third();
}

function third() {
console.log("Hello");
}

first();


The execution roughly looks like:

third()
โ†‘
second()
โ†‘
first()
โ†‘
Global


When "third()" finishes:

third() removed

Then:

second() finishes

Then:

first() finishes

Eventually the stack becomes empty.

โญ 1๏ธโƒฃ8๏ธโƒฃ Call Stack

The call stack follows:

LIFO (Last In, First Out)

For:

function first() {
second();
}

function second() {
console.log("Hello");
}

first();


The stack conceptually becomes:

1. Global

2. first()

3. second()

Then:

second() removed

first() removed

Global continues

Understanding the call stack becomes very important when we later study:

โ€ข Callbacks

โ€ข Asynchronous JavaScript

โ€ข Promises

โ€ข Event loop

โ€ข Stack overflow

โญ 1๏ธโƒฃ9๏ธโƒฃ Scope vs Execution Context

These concepts are related but not identical.

โ€ข Scope answers: "Where can this variable be accessed?"

โ€ข Execution context answers more broadly: "What environment is JavaScript using while executing this code?"

For example:

const name = "Rahul";

function greet() {
const message = "Hello";

console.log(name);
console.log(message);
}


Scope determines which variables are accessible.

Execution context represents the environment created when "greet()" is actually executed.

โญ 2๏ธโƒฃ0๏ธโƒฃ Closures Preview

Closures are built on lexical scope.

Consider:

function createCounter() {

let count = 0;

return function () {
count++;
return count;
};
}

const counter = createCounter();

console.log(counter());
console.log(counter());
console.log(counter());


Output:

1
2
3


The returned function continues to access "count" even after "createCounter()" has finished executing.

๐Ÿš€ Double Tap โค๏ธ For More
โค13