Day 70 of #100daysofcode Today I'll just be posting about a really great article that helped me better understand object oriented programming in JavaScript. At the end of the day, classes are just functions in JavaScript that return objects which contain prototypes. Prototypes store the methods and properties that can be accessed by all object instances of a particular class. This article below discusses more about object prototypes, getters, setters, and so much more! https://lnkd.in/d_NE3aTH In my next post, I will be posting the project requirements for my small todo list application.
Understanding JavaScript Classes and Prototypes
More Relevant Posts
-
🚀 Just published a new blog on Understanding Object-Oriented Programming (OOP) in JavaScript. In this article, I explain the basics of OOP, including what classes are, how to create objects using classes, the constructor method, and methods inside a class. I also used simple real-world examples like blueprints and objects to make the concept easy to understand. 📖 Read the full article here: https://lnkd.in/gKUGBNMR Inspired by the amazing teaching of Hitesh Choudhary Sir and Piyush Garg Sir from Chai Aur Code . ☕💻 #javascript #webdevelopment #oop #learninginpublic #chaiAurCode
To view or add a comment, sign in
-
New blog on object-oriented programming in JavaScript. It covers the core ideas behind OOP, what it means, why it’s useful, and how concepts like objects, classes, and related behavior help structure code more clearly. If you’re learning JavaScript fundamentals, this might be helpful: https://lnkd.in/g7ARP9bJ Feedback is welcome. Chai Aur Code Hitesh Choudhary Piyush Garg
To view or add a comment, sign in
-
🚀 Just published a new blog: 𝗨𝗻𝗱𝗲𝗿𝘀𝘁𝗮𝗻𝗱𝗶𝗻𝗴 𝗢𝗯𝗷𝗲𝗰𝘁-𝗢𝗿𝗶𝗲𝗻𝘁𝗲𝗱 𝗣𝗿𝗼𝗴𝗿𝗮𝗺𝗺𝗶𝗻𝗴 𝗶𝗻 𝗝𝗮𝘃𝗮𝗦𝗰𝗿𝗶𝗽𝘁 If you’ve ever felt confused about classes, instances, `new` keyword, or how OOP actually works under the hood in JS — this one’s for you. I’ve broken it down step-by-step with practical examples, real-world analogies, and code snippets that actually make sense. Whether you’re a beginner trying to level up or an experienced dev looking for a solid refresher, I hope it helps clear things up! 🔗 Read it here: https://lnkd.in/gk4W-7_a Hitesh Choudhary Piyush Garg Akash Kadlag Suraj Kumar Jha Anirudh J. Chai Aur Code Jay Kadlag Nikhil Rathore Happy coding! 💻 #JavaScript #OOP #WebDevelopment #Programming #DeveloperCommunity #TechBlog
To view or add a comment, sign in
-
Prototypes in JavaScript (The Secret Behind Everything) JavaScript doesn’t use classical inheritance like Java or C++ 👉 It uses Prototypal Inheritance --- 💡 Every object in JS has a hidden link: "[[Prototype]]" --- ⚡ Example: const animal = { speak() { console.log("Animal speaks"); } }; const dog = Object.create(animal); dog.speak(); // 🐶 Animal speaks --- 🤯 What just happened? - "dog" does NOT have "speak()" - JavaScript looks into its prototype - Finds it in "animal" 👉 This is called the Prototype Chain --- 🧩 Real Magic: [].map === Array.prototype.map // true 👉 That’s why arrays have methods like "map", "filter", etc. --- ⚠️ Important: dog.__proto__ === animal // true But avoid using "__proto__" directly Use "Object.getPrototypeOf()" --- 🚀 Why this matters: - Foundation of JS inheritance - Helps understand classes under the hood - Makes debugging easier --- Reference from 👉 Sheryians Coding School #javascript #webdevelopment #frontend #programming #coding
To view or add a comment, sign in
-
-
In this insightful article, Ramazan Maksyutov explores the connections between Atomic CSS and functional programming principles in web development. I found it interesting that viewing CSS through the lens of functional programming can lead to more modular and reusable styles. What are your thoughts on integrating functional programming concepts into CSS design? Read more here: https://lnkd.in/dwJN_NVv
To view or add a comment, sign in
-
🔥 *A-Z JavaScript Roadmap for Beginners to Advanced* 📜⚡ *1. JavaScript Basics* - Variables (var, let, const) - Data types - Operators (arithmetic, comparison, logical) - Conditionals: if, else, switch *2. Functions* - Function declaration & expression - Arrow functions - Parameters & return values - IIFE (Immediately Invoked Function Expressions) *3. Arrays & Objects* - Array methods (map, filter, reduce, find, forEach) - Object properties & methods - Nested structures - Destructuring *4. Loops & Iteration* - for, while, do...while - for...in & for...of - break & continue *5. Scope & Closures* - Global vs local scope - Block vs function scope - Closure concept with examples *6. DOM Manipulation* - Selecting elements (getElementById, querySelector) - Modifying content & styles - Event listeners (click, submit, input) - Creating/removing elements *7. ES6+ Concepts* - Template literals - Spread & rest operators - Default parameters - Modules (import/export) - Optional chaining, nullish coalescing *8. Asynchronous JS* - setTimeout, setInterval - Promises - Async/await - Error handling with try/catch *9. JavaScript in the Browser* - Browser events - Local storage/session storage - Fetch API - Form validation *10. Object-Oriented JS* - Constructor functions - Prototypes - Classes & inheritance - `this` keyword *11. Functional Programming Concepts* - Pure functions - Higher-order functions - Immutability - Currying & composition *12. Debugging & Tools* - console.log, breakpoints - Chrome DevTools - Linting with ESLint - Code formatting with Prettier *13. Error Handling & Best Practices* - Graceful fallbacks - Defensive coding - Writing clean & modular code *14. Advanced Concepts* - Event loop & call stack - Hoisting - Memory management - Debounce & throttle - Garbage collection *15. JavaScript Framework Readiness* - DOM mastery - State management basics - Component thinking - Data flow understanding *16. Build a Few Projects* - Calculator - Quiz app - Weather app - To-do list - Typing speed test 🚀 *Top JavaScript Resources* • MDN Web Docs • JavaScript.info • FreeCodeCamp • Net Ninja (YT) • CodeWithHarry (YT) • Scrimba • Eloquent JavaScript (book) 💬 *Tap ❤️ for more!* #webdeveloop #js
To view or add a comment, sign in
-
Assalam o Alaikum everyone, JavaScript Lesson 28 is here: Classes & OOP. In this lesson, I explained one of the most important parts of modern JavaScript: Object-Oriented Programming with classes. You will learn how to create classes, use constructors, build instance methods, and work with `this` inside your objects. I also covered inheritance using `extends` and `super()`, so you can see how one class can reuse and expand another class. On top of that, I demonstrated getters and setters for computed properties, and static methods for utility-style behavior that belongs to the class itself rather than an individual object. In the code example, I used: • `Person` class for basic class structure • `Student` class for inheritance • `User` class for getters and setters • `MathHelper` class for static methods This lesson is useful if you want to understand how real-world JavaScript apps are structured and how OOP helps keep code clean, reusable, and organized. Watch the lesson: https://lnkd.in/dKA4Q--A #JavaScript #OOP #JavaScriptClasses #Inheritance #StaticMethods #GettersAndSetters #FrontendDevelopment #WebDevelopment #DeveloperMaroof #LearnJavaScript
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
-
-
🚀 Day 81 JavaScript OOP: What I Learned Recently Recently, I dived deeper into Object-Oriented Programming (OOP) in JavaScript, and honestly, it changed the way I look at writing code 👇 🔹 Prototypes (Core Concept) Before classes, JavaScript used prototypes for inheritance. Every object is internally linked to another object. Understanding this made everything else much clearer. 🔹 Factory Functions Functions that return objects. Very simple and beginner-friendly, but not memory efficient because each object stores its own copy of methods. 🔹 Constructor Functions & new Using the new keyword, we can create multiple objects efficiently. Methods are shared using prototypes, which saves memory. 🔹 Classes (Modern JavaScript) ES6 introduced classes, making code cleaner and easier to read. But the important thing is — classes are just syntactic sugar over prototypes. 🔹 Inheritance With extends and super(), we can reuse code and build scalable applications. This is where OOP becomes really powerful. 🔹 GET & POST Requests (Backend Basics) GET → used to fetch data (data visible in URL) POST → used to send data securely (data in request body) 💡 My Key Takeaways: ✔ JavaScript is flexible, not strictly OOP ✔ Understanding prototypes is more important than memorizing classes ✔ Writing structured code makes projects scalable and clean This journey helped me move from just writing code → to actually understanding how things work behind the scenes ⚡ Still learning, but getting better every day 🚀 #JavaScript #OOP #WebDevelopment #NodeJS #LearningJourney #Coding
To view or add a comment, sign in
-
-
30 Days JavaScript Challenge: Day 23 ✅ Today’s problem was about building our own version of groupBy() something that’s actually super useful in real projects. The idea was simple: Take an array, run a function on each element, and group elements based on the key that function returns. What I liked about this one is how it makes you think about data transformation not just looping, but structuring data in a cleaner and more usable way. Something like: Group users by id Split numbers based on a condition Organize data for UI rendering All of this becomes much easier once you understand this pattern. Another small step, but feels like I’m getting better at writing cleaner and more practical JavaScript. #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
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