Starting my JavaScript learning journey — sharing what I learn every day. 🚀 📅 JavaScript Learning Journey — Day 8 Today I learned about Loops in JavaScript — a powerful way to repeat tasks efficiently. Loops help us execute the same block of code multiple times without writing it again and again. --- 🔎 1. for Loop (Most Used) for (let i = 1; i <= 5; i++) { console.log(i); } 👉 Output: 1 2 3 4 5 --- 🔎 2. while Loop let i = 1; while (i <= 5) { console.log(i); i++; } --- 🔎 3. do...while Loop let i = 1; do { console.log(i); i++; } while (i <= 5); --- 🧠 When to use what? • "for" → when you know how many times to loop • "while" → when condition-based loop • "do...while" → runs at least once --- 📌 Key Takeaways (Day 8) • Loops reduce repetitive code • "for" loop is most commonly used • Always be careful with infinite loops ⚠️ --- This is Day 8 of my JavaScript learning series. Next, I’ll explore Functions in JavaScript. #JavaScript #WebDevelopment #FrontendDeveloper #LearningInPublic #100DaysOfCode
JavaScript Loops: for, while, do...while Explained
More Relevant Posts
-
🚀 Day 10 of My JavaScript Learning Journey Today I explored JavaScript Functions — the core building blocks of any application. 📌 Key concepts I learned: 🔹 Types of Functions • Named Functions – Functions with a defined name • Anonymous Functions – Functions without a name, often used for one-time use • Arrow Functions (=>) – Modern and concise syntax 🔹 Function Expressions • Functions can be assigned to variables and treated like data 🔹 Advanced Concepts • First-Class Functions – Functions can be passed as arguments and returned from other functions • Higher-Order Functions – Functions that work with other functions • IIFE (Immediately Invoked Function Expression) – Executes immediately after definition 🔹 Scope & Closures • Nested Functions create scope within scope • Important for managing variables and data access 🔹 Generators • Functions that allow pausable execution using yield ⚙️ Understanding functions is crucial because they help write modular, reusable, and efficient code. Step by step, I’m building strong JavaScript fundamentals and problem-solving skills. 💻✨ #JavaScript #WebDevelopment #FrontendDevelopment #CodingJourney #LearningInPublic #DeveloperJourney #ProgrammingBasics
To view or add a comment, sign in
-
-
Day 07 of My JavaScript Learning 👉 Finding the largest among three numbers How to compare multiple values using if-else Writing clean and readable conditions Converting logic into a reusable function // Find the largest among 3 numbers let firstNum = 5; let secondNum = 10; let thirdNum = 2; if (firstNum >= secondNum && firstNum >= thirdNum) { console.log(firstNum); } else if (secondNum >= firstNum && secondNum >= thirdNum) { console.log(secondNum); } else { console.log(thirdNum); } 🔁 Making it reusable with a function: let largestInFunction = function(firstNum, secondNum, thirdNum) { if (firstNum >= secondNum && firstNum >= thirdNum) { return firstNum; } else if (secondNum >= firstNum && secondNum >= thirdNum) { return secondNum; } else { return thirdNum; } } console.log(largestInFunction(3, 1, 4)); 🌱 My takeaway: Even simple problems help build strong fundamentals. The goal is not just solving — but understanding the logic behind it. #Day07 #JavaScript #LearningJourney #FrontendDeveloper #CodingPractice
To view or add a comment, sign in
-
🚀 Day 3 of My JavaScript Learning Journey Today I explored some core concepts of JavaScript that every beginner must understand — and honestly, things are starting to make more sense now! 🔢 1. Numbers in JavaScript JavaScript has only one type for numbers — no separate integer or float. Example: 10 / 20 = 0.5 Even though both are integers, the output is a decimal. Simple but powerful! ✅ 2. Boolean Logic Understanding true/false conditions: 3 >= 3 → true 2 >= 3 → false Also learned something interesting 👇 Expressions are evaluated left to right: 1 >= 0 <= 5 < 6 >= 0 → true 🔄 3. Typecasting == → checks only value === → checks value + type This small difference can save you from big bugs! ⚡ 4. Logical Operators & Short Circuiting || (OR) → if any condition is true && (AND) → all conditions must be true ! (NOT) → reverses the result 👉 Short Circuiting: As soon as JavaScript gets the result, it stops checking further. Example: let marks = 45; let attendance = 60; if (marks >= 33 || attendance >= 75) { console.log("You are pass"); } else { console.log("Fail"); } 💡 Even if one condition is true, it won’t check the next! 🧵 5. Strings & Template Literals Instead of messy concatenation, we can use template literals: let naam = "Surbhi"; let kaam = "Web Developer"; let shaher = "Gurgaon"; let output = `Hi, I am ${naam}, a ${kaam} in ${shaher}`; Clean, readable, and modern ✨ 📌 Small steps every day… but building strong foundations! #javascript #codingjourney #webdevelopment #learninginpublic
To view or add a comment, sign in
-
🚀 2 Important JavaScript Concepts Every Developer Should Know! If you're learning JavaScript, understanding these two concepts can seriously level up your coding skills 👇 🔹 Hoisting JavaScript moves declarations to the top before execution. 👉 That’s why you can use variables/functions before declaring them. 💡 Key Takeaway: var is hoisted with undefined, while let and const are hoisted but not initialized. 🔹 Closures A closure allows a function to access variables from its outer scope even after the outer function has finished execution. 💡 Key Takeaway: Closures are powerful for maintaining state and creating private variables. 📚 Want to learn more? 👉 Hoisting: https://lnkd.in/djMH7JzY 👉 Closures: https://lnkd.in/dtk38xwW Big thanks to w3schools.com for making JavaScript concepts easy to understand 🙌 💬 Which concept was harder for you to understand — Hoisting or Closures? 🔖 Save this post & share with your developer friends! #JavaScript #WebDevelopment #Frontend #Coding #Programming #Developers #LearnToCode #Closures #Hoisting #W3Schools
To view or add a comment, sign in
-
-
🚨 STOP SCROLLING if you're learning JavaScript... Quick question 👇 ❓ Are you still confused with JS basics or async stuff? Because this might fix that. I found a 40-page handwritten JavaScript notes PDF and it’s honestly GOLD 💯 No boring theory. No overcomplicated explanations. Just clear concepts + real examples. 📘 What’s inside? (Basics → Advanced) 🔥 Variables, Data Types & Operators (super clean explanations) 🔥 Functions, Scope & Closures (finally makes sense 🤯) 🔥 Arrays & Objects (real-life examples you’ll remember) 🔥 DOM Manipulation (actual use-cases, not just theory) 🔥 Async JS (Callbacks, Promises, async/await simplified) 🔥 Error Handling & Debugging 🔥 ES6+ (Arrow functions, destructuring, modules) 🔥 Mini Project Guide (so you actually build something 🚀) 💡 Why people love it: ✅ Beginner-friendly ✅ Perfect for quick revision ✅ No fluff, only what matters ✅ Easy handwritten format = faster learning ⚠️ Real talk... If you STILL struggle after this... …it’s probably not your resources anymore 😅 💬 Let’s make this fun: 👉 Comment “JS” and I’ll share the notes 👉 OR comment your biggest struggle in JavaScript (I’ll help you out) 👉 Already learning? Drop your level: Beginner / Intermediate / Advanced ❤️ Like if this helped 🔁 Repost to help a friend 💾 Save it for later #JavaScript #WebDevelopment #Coding #Programming #Developer #LearnToCode #CodingLife #Tech #SoftwareDeveloper #100DaysOfCode
To view or add a comment, sign in
-
If you're learning JavaScript, here's a question I hear constantly from beginners: "I've learned functions — but now what do I actually learn next?" It's a genuinely good question. Functions are a major milestone, but the path forward isn't always obvious. We just published a detailed beginner's guide on Brain Busters that maps out the complete next step — in the right order, with real examples and clear explanations. The guide covers: → Conditional statements (if/else/switch) → Loops (for and while) → Arrays and how to work with them → Objects and key-value pairs → Array methods (forEach, map, filter) → The DOM — connecting JavaScript to real webpages → A 4-level roadmap from beginner to framework-ready No jargon. No assumptions. Written for someone who is genuinely at the start of their JavaScript journey. If you're learning JS or know someone who is — this is worth bookmarking. 🔗 https://lnkd.in/gYaKpYpV #JavaScript #WebDevelopment #LearnToCode #Programming #TechEducation
To view or add a comment, sign in
-
🚀 Day 12 of My JavaScript Learning Journey Today I learned about Arrays and Array Methods in JavaScript — one of the most essential concepts for handling data. 📌 What I learned: 🔹 What is an Array? • A collection of elements stored in a single variable • Zero-indexed (starts from 0) 🔹 Ways to Create an Array • Using array literal → [1, 2, 3] • Using constructor → new Array() 🔹 Adding & Removing Elements • push() / unshift() → Add elements • pop() / shift() → Remove elements 🔹 Important Array Methods • map() → Transform elements • filter() → Select specific elements • reduce() → Convert array into a single value 🔹 Searching & Utility Methods • find() / includes() • forEach() → Iterate elements • slice() / splice() → Extract or modify array 💡 Arrays are powerful because they allow us to store, manipulate, and process data efficiently. ⚙️ I also practiced real examples like transforming arrays using map() to create new values. Step by step, I’m improving my problem-solving skills and JavaScript fundamentals. 💻✨ #JavaScript #WebDevelopment #FrontendDevelopment #CodingJourney #LearningInPublic #100DaysOfCode #DeveloperJourney #ProgrammingBasics
To view or add a comment, sign in
-
-
💡 Understanding Closures in JavaScript (My Learning Journey 🚀)💡 🔥Today, I explored one of the most important concepts in JavaScript — Closures 🔥 👉 A closure means: An inner function can access and remember the variables of its outer function, even after the outer function has finished execution. 🧠 What happens behind the scenes? 🔹 When JavaScript runs a program, it creates a Global Execution Context (GEC) and pushes it into the Call Stack. 🔹 Execution happens in two phases: 1️⃣ Memory (Creation Phase) 2️⃣ Code Execution Phase 🔹 When a function is invoked, a new Execution Context is created and pushed into the stack. 🔹 JavaScript follows lexical scope, meaning inner functions can access variables from their outer scope. 🔥 The Magic of Closures Even after the outer function completes execution and is removed from the call stack, the inner function still has access to the outer function’s variables. 👉 This is because the function maintains a reference to its lexical environment. 👉 Using the scope chain, JavaScript can still find and access those variables. 🎯 Key Concepts Involved ✅ Execution Context ✅ Call Stack ✅ Lexical Scope ✅ Scope Chain ✅ Closures 🚀 Why Closures are Powerful? ✔ Helps in data hiding (Encapsulation) ✔ Useful for maintaining state ✔ Used in callbacks and asynchronous programming ✔ Enables function factories 🔥 Conclusion Closures show how powerful JavaScript functions are. They don’t just execute — they remember where they were created. Understanding closures deeply helps in writing better and more efficient code. 💯 #JavaScript #Closures #WebDevelopment #FrontendDevelopment #CodingJourney #LearnInPublic #JSInternals #Developers
To view or add a comment, sign in
-
-
🚀 Day 14 of My JavaScript Learning Journey Today I learned about JavaScript Objects — Access, Add, Update & Delete properties. 📌 Key concepts I explored: 🔹 What is an Object? • A collection of key-value pairs • Used to store structured data Example: let user = { name: "Sanjay", age: 21 }; 🔹 Accessing Object Data • Dot Notation → user.name • Bracket Notation → user["age"] 💡 Bracket notation is useful when keys are dynamic or contain special characters. 🔹 Modifying Objects • Add → user.city = "Bangalore" • Update → user.age = 22 🔹 Deleting Properties • Use delete keyword Example: delete user.city; 🔹 Important Insight • Objects are mutable, meaning they can be changed after creation 💡 Understanding objects is essential because they are widely used to represent real-world data in applications. Step by step, I’m improving my JavaScript fundamentals and practical coding skills. 💻✨ #JavaScript #WebDevelopment #FrontendDevelopment #CodingJourney #LearningInPublic #100DaysOfCode #DeveloperJourney #ProgrammingBasics
To view or add a comment, sign in
-
-
🚀 Learning Update – JavaScript Basics Today’s focused learning session (2:00 PM – 3:00 PM): 📘 Topic Covered: Introduction to Programming + JavaScript Basics I started with understanding what programming is and how JavaScript fits into it. Then I learned about: ⚡ What is ECMAScript? ECMAScript is the standard specification on which JavaScript is built. In simple terms: 👉 ECMAScript = Rules 👉 JavaScript = Language that follows those rules It defines how JavaScript should behave, how syntax works, and how features are implemented in browsers. 💻 How JavaScript executes? JavaScript code runs in the browser (or Node.js) using a JavaScript engine like V8. Steps: Code is written in .js file Browser reads it JavaScript engine executes it line by line Output is shown in console or UI 🧠 Key takeaway: Understanding the basics is more important than just writing code. Today I focused on clarity over speed. 📌 Next step: I will continue practicing fundamentals and build small hands-on examples daily. #JavaScript #WebDevelopment #LearningJourney #FrontendDevelopment #Consistency #ProgrammingBasics
To view or add a comment, sign in
Explore content categories
- Career
- Productivity
- Finance
- Soft Skills & Emotional Intelligence
- Project Management
- Education
- Technology
- Leadership
- Ecommerce
- User Experience
- Recruitment & HR
- Customer Experience
- Real Estate
- Marketing
- Sales
- Retail & Merchandising
- Science
- Supply Chain Management
- Future Of Work
- Consulting
- Writing
- Economics
- Artificial Intelligence
- Employee Experience
- Workplace Trends
- Fundraising
- Networking
- Corporate Social Responsibility
- Negotiation
- Communication
- Engineering
- Hospitality & Tourism
- Business Strategy
- Change Management
- Organizational Culture
- Design
- Innovation
- Event Planning
- Training & Development