Day 22 of my web development journey in Chai Code cohort. Completed Object-Oriented Programming (Part 2) by Hitesh Choudhary . This lecture continued from the previous one but went deeper into how JavaScript actually works behind the scenes. The first important realization: Classes in JavaScript are not what they seem. They look like traditional OOP classes, but internally they are just syntax over prototypes. Understanding this changed how I see classes completely. One key thing I understood: Methods inside class are shared But functions defined inside constructor are not That means: ->Class methods are memory efficient ->Constructor functions create separate copies per instance Then came Symbols At first it looked like a small topic, but it has a strong use case. ->Symbols always create unique values ->Even if the description is same ->Useful when you want hidden or non-colliding keys Also learned: Symbol keys don’t show up in Object.keys() You need Object.getOwnPropertySymbols() to access them Another interesting concept: Making objects iterable Normally, objects are not iterable But using Symbol.iterator, we can control how iteration works This was something I didn’t expect JavaScript to allow so easily. Also covered: Symbol.toPrimitive This controls how an object behaves when converted to string or number. It gives more control over type conversion. Error handling became clearer: try → catch → finally ->try: risky code ->catch: handle error ->finally: always runs This is important for writing stable applications. Then came async flow: Callback approach → nested and hard to manage Promises: ->cleaner ->chainable ->easier to handle success and failure Big takeaway: JavaScript gives a lot of control, but with that comes responsibility to understand what is happening internally. Day 22 done. This OOP part needs more practice to fully sink in. Thank you Hitesh Choudhary sir, Piyush Garg sir, Anirudh Jwala sir, Suraj Kumar Jha for the support. #JavaScript #WebDevelopment #CodingJourney #LearnToCode #100DaysOfCode #Developers #Programming #TechCareers
JavaScript OOP Concepts with Hitesh Choudhary
More Relevant Posts
-
🚀 JavaScript Simplified Series — Day 40 🎉 40 Days… 40 Posts… 1 Goal → Master JavaScript from scratch 🚀 If you’ve followed till here… You didn’t just learn JS — 👉 You built discipline 👉 You built consistency 👉 You built a developer mindset 🔥 What You’ve Covered From basics to advanced 👇 ✔ Variables, Data Types ✔ Operators, Conditions ✔ Loops ✔ Functions ✔ Arrays & Objects ✔ DOM & Events ✔ Async JavaScript ✔ Promises & Async/Await ✔ Event Loop ✔ Closures, Scope, Hoisting ✔ Prototypes & Classes ✔ Inheritance & Modules ✔ Debounce & Throttle 👉 This is not beginner level anymore 😎 🔥 Realization Moment At the start: 👉 “JavaScript is confusing” Now: 👉 “I can build things with JavaScript” That’s the real transformation 💯 🎁 Bonus for You I’ve also created complete JavaScript notes 📒 covering everything from this series 👉 Clean 👉 Beginner-friendly 👉 Quick revision ready If you want the notes 👇 💬 Comment “JS NOTES” or DM me — I’ll share it with you 🔥 What Next? Don’t stop here ❌ Start building: 👉 Projects (Todo App, Weather App) 👉 Frontend (React) 👉 Backend (Node.js) 👉 Full Stack Apps 🔥 Final Advice 👉 Don’t just watch tutorials 👉 Build projects 👉 Break things 👉 Fix them That’s how real developers grow 💡 Programming Rule Learning ends when you stop building. Keep building. Keep growing.** 🙌 If this series helped you 👉 Like ❤️ 👉 Share 🔁 👉 Comment your learning 👇 Let’s grow together 🚀 --- 📌 Series Completed 🎯 Day 1 → What is JavaScript ... Day 40 → Complete JavaScript Journey Follow for more 🚀 #JavaScriptSimplified #javascript #webdevelopment #coding #programming #learninpublic #100DaysOfCode #frontenddevelopment #devcommunity #codingjourney #softwaredeveloper #techcommunity #dailylearning #LeetCode #DSA #CodingJourney #Consistency #ProblemSolving #SoftwareEngineering #KeepGoing #codeeveryday
To view or add a comment, sign in
-
🚀 Dive into the exciting world of asynchronous programming with JavaScript Promises! 🌟 Promises are a way to handle asynchronous operations in JavaScript, ensuring that a certain task is completed before moving on to the next one. Imagine ordering food online - you don't wait for the delivery before doing anything else, right? Promises work the same way! For developers, understanding Promises is crucial as it allows for smoother execution of tasks without blocking the main thread. This can lead to better performance and user experience in applications. 🔧 Here's a breakdown: 1. Create a new Promise using the "new Promise()" constructor. 2. Inside the Promise, define the asynchronous task (e.g., fetching data). 3. Use ".then()" to handle the successful outcome. 4. Use ".catch()" to handle errors. ``` const fetchData = new Promise((resolve, reject) => { // asynchronous task here resolve('Data fetched successfully!'); }); fetchData .then((data) => { console.log(data); }) .catch((error) => { console.log(error); }); ``` Pro Tip: Utilize async/await with Promises for even cleaner and more readable asynchronous code! 😊 Common Mistake Alert: Forgetting to handle errors with ".catch()" can result in uncaught Promise rejections. Always include error handling for robust code. 🤔 What will be your first project applying Promises to level up your development skills? Share your thoughts below! 🚀🌐 View my full portfolio and more dev resources at tharindunipun.lk #JavaScript #AsyncProgramming #Promises #WebDevelopment #CodingTips #AsyncAwait #DeveloperCommunity #CodeNewbie #FrontendDevelopment
To view or add a comment, sign in
-
-
"JS Fundamentals Series #5: Event Loop & Async Programming" Ever wondered why promises resolve before setTimeout, even with zero delay? That's the magic of the Event Loop - The mechanism that makes JavaScript handle asynchronous tasks while staying single-threaded. 👉 Event Loop: Continuously checks the call stack and queues, moving tasks into execution when the stack is clear. 👉 Call Stack, Callback Queue, Microtask Queue: - Call Stack - Executes synchronous code line by line. - Microtask Queue - Holds promises and async/await tasks (executed before callbacks) - Callback Queue - Holds taste like setTimeout and event handlers. 🔹 Explanation - The event loop ensures non-blocking execution. - Promises (microtasks) always run before callbacks (macrotasks). - This explains why async code often behaves differently than expected. 🔹 Example console.log("Start"); setTimeout(() => { console.log("Timeout"); }, 0); Promise.resolve().then(() => { console.log("Promise"); }); console.log("End"); Output: Start End Promise Timeout 🔹 Analogy Think of it like a restaurant: - Call Stack: Chef cooking immediate orders. - Microtask Queue (Promises): VIP priority orders. - Callback Queue (setTimeout): Regular orders waiting in line. 🔹 Why It Matters - Explains async behavior that confuses beginners. - Helps debug performance issues. - Essential for mastering async/await and modern frameworks like React. 💡 Takeaway: Understanding the Event Loop is key to mastering asynchronous programming in JavaScript. #JavaScript #WebDevelopment #AsyncProgramming #Frontend #ReactJS #CodingTips #DeveloperCommunity #NamasteJS #LearningJourney #TechExplained #CareerGrowth "Event Loop in action: Call Stack → Microtask Queue → Callback Queue 👇"
To view or add a comment, sign in
-
-
Many developers think map() and forEach() are interchangeable. They’re not. Understanding the difference is one of those small things that separates average code from clean, efficient code. Here’s a quick insight: • map() → Returns a new array (used for transformation) • forEach() → Does not return anything (used for side effects) But the real challenge isn’t knowing this — it’s knowing when to use each in real-world scenarios. I’ve broken this down in my latest article with: Practical examples Common mistakes developers make Interview-oriented explanations If you're serious about improving your JavaScript fundamentals, this will help. Read here: https://lnkd.in/gZybUc7p What’s your go-to method when working with arrays? #JavaScript #WebDevelopment #Frontend #SoftwareEngineering #Coding #Programming #TechLearning #DeveloperTips #CareerGrowth
To view or add a comment, sign in
-
I just published my new technical blog! 🚀 This time, I wrote about Control Flow in JavaScript — covering if/else statements and switch cases, explained in a beginner-friendly way with examples and simple analogies. If you're on your JavaScript journey and want to understand how your code makes decisions, this one's for you! 📖 Read the article here: https://lnkd.in/gHZNjfBc Special thanks to Hitesh Choudhary and Piyush Garg for making these concepts so easy to grasp. Their teaching style always makes things click! 🙌 I'd really appreciate your feedback — drop a comment or a reaction if you find it helpful! 😊 #javascript #webdevelopment #programming #coding #beginners #chaicode #controlflow #learnjavascript
To view or add a comment, sign in
-
🚀 Diving into JavaScript Functions! 🚀 Functions are like recipes in programming 🍳 They are blocks of code that perform a specific task when called. Developers use functions to organize code, make it reusable, and improve readability. Understanding functions is essential for every developer to write efficient and maintainable code. Let's break it down: 1️⃣ Declare a function using the keyword "function" followed by a name and parameters. 2️⃣ Write the code block inside curly braces to define what the function does. 3️⃣ Call the function by using its name and passing any required arguments. Check out this example: ```javascript function greet(name) { return `Hello, ${name}!`; } console.log(greet("Alice")); ``` Pro Tip: Don't forget to use meaningful function names and keep them concise for better code organization. 🌟 Common Mistake Alert: Forgetting to return a value from the function can lead to unexpected behavior. Always ensure your functions explicitly return a value when needed. 🤔 What's your favorite function to write and why? Share in the comments below! 🤓 🌐 View my full portfolio and more dev resources at tharindunipun.lk #JavaScriptFunctions #CodeOrganization #ReusableCode #WebDevelopment #LearnToCode #ProgrammingTips #FunctionBestPractices #TechTutorials #DeveloperCommunity
To view or add a comment, sign in
-
-
🔥 Master the art of coding loops in JavaScript! 🚀 Loops are a fundamental concept in programming that allow you to execute a block of code multiple times. They are essential for automating repetitive tasks and iterating over data structures. For developers, understanding loops is crucial for writing efficient and concise code. Whether you're working on data manipulation, user interfaces, or backend logic, loops help you process large amounts of data with ease. Here's a step-by-step breakdown: 1️⃣ Initialize a counter variable 2️⃣ Set the condition for the loop to continue 3️⃣ Execute the code block inside the loop 4️⃣ Update the counter variable at the end of each iteration Check out the code example below: ``` for (let i = 0; i < 5; i++) { console.log('Hello, loop ' + i); } ``` Pro Tip: Use caution with infinite loops! Always ensure your loop has a clear exit condition to avoid crashing your program. Common Mistake Alert: Forgetting to update the counter variable in a loop can lead to infinite loops. Always remember to increment or decrement the counter inside the loop. 🌟 Question for you: What creative project are you currently working on with loops in your code? Share below! 💡 🌐 View my full portfolio and more dev resources at tharindunipun.lk #JavaScript #CodingLoops #ProgrammingBasics #DevTips #LoopMastery #CodeNewbie #TechTalk #DeveloperCommunity #DigitalSkills
To view or add a comment, sign in
-
-
Understanding the Event Loop in JavaScript is a turning point for every developer. Many developers use async features like promises, setTimeout, or async/await daily — but very few truly understand what happens behind the scenes. I’ve written a detailed yet easy-to-understand article that breaks down: ✔ Call Stack ✔ Callback Queue ✔ Microtask Queue ✔ Execution Order If you want to strengthen your JavaScript fundamentals and avoid common async mistakes, this will definitely help. 👉 Read the full article: https://lnkd.in/gDhwvmUc I’d love to hear your thoughts — what was the hardest concept for you when learning the Event Loop? #JavaScript #SoftwareDevelopment #WebDevelopment #FrontendDevelopment #AsyncProgramming #Coding #TechLearning
To view or add a comment, sign in
-
🚀 Mastering Asynchronous Programming in JavaScript 🚀 Ever wondered how to handle asynchronous operations in JavaScript like a pro? 🤔 Let's break it down! Asynchronous programming allows tasks to run separately from the main program flow, helping in managing time-consuming operations efficiently. For developers, understanding async programming is crucial for creating responsive and efficient web applications. 🔧 Here's the breakdown: 1. Use async functions to handle asynchronous operations. 2. Utilize the await keyword to pause execution until a promise settles. 3. Catch any errors using try/catch blocks. Check out this code snippet for a clear example: ```javascript async function fetchData() { try { let response = await fetch('https://lnkd.in/gc8PxW6P'); let data = await response.json(); console.log(data); } catch (error) { console.log('Error fetching data:', error); } } ``` Pro Tip 💡: Remember to handle errors gracefully to prevent your application from breaking during async operations! Common Mistake ❌: Forgetting to handle promise rejections can lead to uncaught errors in your code. 🤔 What's your favorite method for handling asynchronous tasks in JavaScript? Share with us in the comments below! 🌐 View my full portfolio and more dev resources at tharindunipun.lk #JavaScript #AsyncProgramming #WebDevelopment #CodingTips #FrontEnd #DevelopersCommunity #ErrorHandling #CodeSnippet #LearnToCode
To view or add a comment, sign in
-
-
I recently started diving deeper into JavaScript, and honestly… one concept completely changed how I see code execution 🤯 At first, I used to just write code and expect it to “run.” But then I discovered what actually happens behind the scenes 👇 JavaScript doesn’t just execute code directly. It goes through a process: 🔹 First, it creates a Global Execution Context 🔹 Then comes the Memory Phase (where variables get stored as undefined and functions are fully saved) 🔹 After that, the Execution Phase runs code line by line 🔹 And everything is managed using a Call Stack (LIFO — Last In, First Out) Understanding this made things like hoisting, function calls, and even bugs feel way less random. Now when I write code, I don’t just see syntax — I can actually visualize what the JavaScript engine is doing step by step 🧠⚡ Still learning, but this was one of those “aha” moments that made everything clearer. If you're learning JavaScript, don’t skip this part — it’s a game changer 🚀 #JavaScript #WebDevelopment #LearningJourney #Frontend #Programming #Developers
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