JAVASCRIPT
JavaScript Fundamentals: Day 4
     30 Days Of JavaScript
Greetings and welcome back to our thrilling ” 30 Days of Javascript” Today, on Day 4, we’re digging deep into the principles of JavaScript. You’re getting better at JavaScript every day, and today’s excursion looks to be nothing short of enchanting.Â
We will summon the beauty of functions, harness the might of operators and expressions, discover the mysteries of conditional statements and loops, and explore this beautiful world. As we explore the fascinating world of JavaScript, get ready to wave your coding magic wand.Â

Section 1: Operators and Expressions – The Language of Enchantment
JavaScript’s intriguing language is built around operators. They give you the ability to do amazing operations on variables and values. You open a door to a universe of possibilities with each operator.
let num1 = 5;
let num2 = 3;
let sum = num1 + num2; // Active Voice: We add num1 and num2 to get the sum.
console.log(sum); // Output: 8
 Youtube Video :
Section 2: Conditional StatementsÂ
let hour = 15;
let greeting;
if (hour < 12) {
 greeting = "Good morning!"; // Active Voice: We set the greeting to "Good morning!"
} else {
 greeting = "Good afternoon!"; // Active Voice: We set the greeting to "Good afternoon!"
}
console.log(greeting); // Output: "Good afternoon!"

Section 3: Loops – Unraveling Infinite Possibilities
for (let i = 1; i <= 5; i++) { Â console.log("Count: " + i); // Active Voice: We print the current count. }}}Â
Section 4: Functions – The Elegance of Reusable Magic
function greet(name) { return "Hello, " + name + "!"; // Active Voice: We return a personalized greeting. } let greeting = greet("John"); console.log(greeting); // Output: "Hello, John!"
Section 5: Variable Scope – The Boundaries of Your Magic Kingdom
javascriptCopy code
let globalSpell = "PWSC"; // Active Voice: We declare a global spell.
function castSpell() {
 let localSpell = "Updategadh"; // Active Voice: We declare a local spell inside the function.
console.log(globalSpell + " " + localSpell); // Output: "Abracadabra Alakazam"}
castSpell();
console.log(globalSpell); // Output: "Abracadabra"
console.log(localSpell); // Error: localSpell is not definedSection 6: JavaScript in the Real World – Enchanting Applications
javascriptCopy code const button = document.getElementById("myButton"); button.addEventListener("click", () => { Â alert("You clicked the button!"); // Active Voice: We show an alert when the button is clicked.});
🎓 Need Complete Final Year Project?
Get Source Code + Report + PPT + Viva Questions (Instant Access)
🛒 Visit UpdateGadh Store →