TGViewer
Web Development Web Development @webdevcoursefree ยท 79.7K subscribers
Post #3363 5.26K
โœ… JavaScript Basics You Should Know ๐ŸŒโœจ

JavaScript is a scripting language used to make websites interactive โ€” handling user actions, animations, and dynamic content.

1๏ธโƒฃ Variables & Data Types
Use let for reassignable variables, const for constants (avoid var due to scoping issues).
let name = "Alex";  
const age = 25;

Data Types: string, number, boolean, object, array, null, undefined.

2๏ธโƒฃ Functions
Reusable blocks of code.
function greet(user) {
return `Hello, ${user}`;
}

Or use arrow functions for concise syntax:
const greet = (user) => `Hello, ${user}`;


3๏ธโƒฃ Conditionals
if (age > 18) {
console.log("Adult");
} else {
console.log("Minor");
}


4๏ธโƒฃ Loops
for (let i = 0; i < 5; i++) {
console.log(i);
}


5๏ธโƒฃ Arrays & Objects
let fruits = ["apple", "banana"];
let person = { name: "John", age: 30 };


6๏ธโƒฃ DOM Manipulation
document.getElementById("demo").textContent = "Updated!";


7๏ธโƒฃ Event Listeners
button.addEventListener("click", () => alert("Clicked!"));


8๏ธโƒฃ Fetch API (Async)
fetch("https://api.example.com").then(res => res.json()).then(data => console.log(data));


9๏ธโƒฃ ES6 Features
โฆ let, const
โฆ Arrow functions
โฆ Template literals: Hello ${name}
โฆ Destructuring: const { name } = person;
โฆ Spread/rest operators: ...fruits

๐Ÿ’ก Tip: Practice JS in browser console or use online editors like JSFiddle / CodePen.

๐Ÿ’ฌ Tap โค๏ธ for more!
  • โค 9
  • ๐Ÿ”ฅ 3
More from @webdevcoursefree
  1. Oct 17, 2026The Finance cell spans two rows. 10. Tables vs Layout Tables should be used for tabular daโ€ฆ
  2. Oct 17, 2026๐ŸŒ Web Development Roadmap โ€” Part 19 HTML Tables Tables are used to display information inโ€ฆ
  3. Oct 17, 2026๐—œ๐—•๐—  ๐—™๐—ฅ๐—˜๐—˜ ๐—ง๐—˜๐—–๐—› ๐—–๐—ข๐—จ๐—ฅ๐—ฆ๐—˜๐—ฆ ๐Ÿฎ๐Ÿฌ๐Ÿฎ๐Ÿฒ! ๐ŸŽ“ Explore IBM Cognitive Class and buildโ€ฆ
  4. Oct 16, 2026๐——๐—ฎ๐˜๐—ฎ ๐˜€๐—ฐ๐—ถ๐—ฒ๐—ป๐—ฐ๐—ฒ ๐—–๐—ฒ๐—ฟ๐˜๐—ถ๐—ณ๐—ถ๐—ฐ๐—ฎ๐˜๐—ถ๐—ผ๐—ป ๐—ช๐—ถ๐˜๐—ต ๐—”๐—œ๐Ÿ˜ Future Ready Data Scienโ€ฆ
  5. Oct 16, 2026๐ŸŒ Web Development Roadmap โ€” Part 18 HTML Lists Lists are used whenever information needsโ€ฆ
  6. Oct 14, 2026๐ŸŒ Web Development Roadmap โ€” Part 17 HTML Images โ€” <img> Tag Images make webpages more visโ€ฆ
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 โ†’