Fearless • 21d
🚀 Day 2 of 21 – JavaScript Learning Journey Topic: Operations & Conditional Statements 🔹 Operations in JavaScript Arithmetic: + - * / % Assignment: = += -= Comparison: == === != > < >= <= Logical: && || ! 🔹 Conditional Statements // if statement if (age >= 18) { console.log("You can vote!"); } // if...else if (num % 2 === 0) { console.log("Even"); } else { console.log("Odd"); } // if...else if...else if (marks >= 90) { console.log("Grade A"); } else if (marks >= 60) { console.log("Grade B"); } else { console.log("Grade C"); } // switch statement switch(day) { case 1: console.log("Monday"); break; case 2: console.log("Tuesday"); break; default: console.log("Other Day"); } ✨ Key Takeaway: Operations let you calculate & compare, while conditional statements help your code make decisions. 📌 Stay tuned for Day 3 – Loops in JavaScript 🔄 #21DayJavaScript #JavaScript #Coding #LearnToCode
Keen Learner and Exp... • 2m
Day 2 of learning python as a beginner. Topic: Conditional Expression Conditional expression pose a condition (if and Else statements). They help program take decision based on the condition given. They can be used inside a function or while assign
See MoreDownload the medial app to read full posts, comements and news.