TGViewer
Web Development Web Development @webdevcoursefree ยท 79.7K subscribers
Post #3398 4.88K
โœ… JavaScript Basics for Web Development ๐ŸŒ๐Ÿ’ป

1๏ธโƒฃ Variables โ€“ Storing Data
JavaScript uses let, const, and var to declare variables.

let name = "John";       // can change later
const age = 25; // constant, can't be changed
var city = "Delhi"; // older syntax, avoid using it

โ–ถ๏ธ Tip: Use let for variables that may change and const for fixed values.

2๏ธโƒฃ Functions โ€“ Reusable Blocks of Code

function greet(user) {
return "Hello " + user;
}

console.log(greet("Alice")); // Output: Hello Alice

โ–ถ๏ธ Use functions to avoid repeating the same code.

3๏ธโƒฃ Arrays โ€“ Lists of Values

let fruits = ["apple", "banana", "mango"];

console.log(fruits[0]); // Output: apple
console.log(fruits.length); // Output: 3

โ–ถ๏ธ Arrays are used to store multiple items in one variable.

4๏ธโƒฃ Loops โ€“ Repeating Code

for (let i = 0; i < 3; i++) {
console.log("Hello");
}

let colors = ["red", "green", "blue"];
for (let color of colors) {
console.log(color);
}

โ–ถ๏ธ Loops help you run the same code multiple times.

5๏ธโƒฃ Conditions โ€“ Making Decisions

let score = 85;

if (score >= 90) {
console.log("Excellent");
} else if (score >= 70) {
console.log("Good");
} else {
console.log("Needs Improvement");
}

โ–ถ๏ธ Use if, else if, and else to control flow based on logic.

๐ŸŽฏ Practice Tasks:
โ€ข Write a function to check if a number is even or odd
โ€ข Create an array of 5 names and print each using a loop
โ€ข Write a condition to check if a user is an adult (age โ‰ฅ 18)

๐Ÿ’ฌ Tap โค๏ธ for more!
  • โค 14
  • ๐Ÿ‘ 2
More from @webdevcoursefree
  1. Oct 16, 2026๐——๐—ฎ๐˜๐—ฎ ๐˜€๐—ฐ๐—ถ๐—ฒ๐—ป๐—ฐ๐—ฒ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ช๐—ถ๐˜๐—ต ๐—”๐—œ๐Ÿ˜ Future Ready Data Scienโ€ฆ
  2. Oct 16, 2026๐ŸŒ Web Development Roadmap โ€” Part 18 HTML Lists Lists are used whenever information needsโ€ฆ
  3. Oct 14, 2026๐ŸŒ Web Development Roadmap โ€” Part 17 HTML Images โ€” <img> Tag Images make webpages more visโ€ฆ
  4. Oct 13, 2026๐—ง๐—ข๐—ฃ ๐—™๐—ฅ๐—˜๐—˜ ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐—ง๐—ข ๐—•๐—ข๐—ข๐—ฆ๐—ง ๐—ฌ๐—ข๐—จ๐—ฅ ๐—ฆ๐—ž๐—œ๐—Ÿ๐—Ÿ๐—ฆ ๐—œ๐—ก ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ! Explorโ€ฆ
  5. Oct 12, 2026For example: Go to Profile โ†’ <a> Submit Form โ†’ <button> Open Article โ†’ <a> Delete Accountโ€ฆ
  6. Oct 12, 2026๐ŸŒ Web Development Roadmap โ€” Part 16 HTML Links โ€” Tag Links are one of the most importantโ€ฆ
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook โ†’Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 โ†’