Day 98 of my #100DaysOfCodeChallenge Today I explored Object-Oriented Programming in JavaScript using classes. Here’s what I worked on: Built a Product class with methods to display details and calculate total price Learned how constructors initialize object properties Implemented static properties and methods using a utility class Created a User class to track the number of users created This helped me understand the difference between instance-level and class-level behavior, and how to structure code more effectively. It’s a shift from just writing functions to designing systems. #JavaScript #OOP #WebDevelopment #SoftwareEngineering
JavaScript OOP with Classes and Constructors
More Relevant Posts
-
Sharing beginner-friendly notes on Object-Oriented Programming (OOP) in JavaScript 🧠 Covered core concepts like Classes, Constructors, Inheritance, Encapsulation, Polymorphism, Getters/Setters, Static methods, and Private fields (#) with clear examples. Also explained how super, instanceof, and prototypes work behind the scenes. A practical guide to understanding how OOP works in modern JavaScript. Feedback and suggestions are welcome! #JavaScript #OOP #Coding #Learning #Programming
To view or add a comment, sign in
-
Practicing Object-Oriented Programming in JavaScript. Implemented a Product constructor, a Cart class using array methods (reduce, filter, map), and a DiscountCart subclass with inheritance. Focused on clean structure and method organization. #JavaScript #OOP #WebDevelopment #CodingPractice #LearningInPublic #DeveloperJourney
To view or add a comment, sign in
-
-
I recently shared a short blog where I explain Object-Oriented Programming (OOP) in JavaScript along with its four core concepts — Encapsulation, Inheritance, Polymorphism, and Abstraction — using simple and beginner-friendly examples 💡 If you're learning JavaScript or just brushing up your OOP fundamentals, this might be useful for you 🚀 👉 Read the blog here: https://lnkd.in/g-B4g5gk Hitesh Choudhary | Piyush Garg | Suraj Kumar Jha | Chai Code | Akash Kadlag ☕ #JavaScript #OOP #WebDevelopment #Programming #LearnInPublic #Blog #Cohort2026
To view or add a comment, sign in
-
-
🚀 Today I Practiced JavaScript: Quick Sort Algorithm: Sorting is one of the most fundamental concepts in programming, and Quick Sort is a powerful algorithm every developer should know. 💡 Core Concept: Quick Sort follows a divide and conquer approach: 1. Divide the array into smaller parts based on a pivot 2.Conquer by recursively sorting the smaller parts 3.Combine the results to get the final sorted array 🎯 Key Insight: In my JavaScript implementation: 1.I used push() to partition elements into smaller and larger groups 2.I used the spread operator (...) to combine the results efficiently 3.This approach keeps the logic simple while clearly demonstrating how the algorithm works internally. ⚡ Time Complexity: 1. Average: O(n log n) 2. Worst: O(n²) Quick Sort is widely used because of its efficiency and elegant approach to problem-solving. #JavaScript #DSA #Algorithms #Coding #Programming #WebDevelopment #Quick Sort 😊
To view or add a comment, sign in
-
💻 Day 8 of Coding Today I learned about Object-Oriented Programming concepts in JavaScript: 📚 Topics Covered: • Objects & Prototypes • Classes and Constructors • Inheritance • super keyword Understood how: • Objects can share properties using prototypes • Classes act as a blueprint for creating objects • Child classes inherit from parent classes • Method overriding works in inheritance 🛠️ Practiced by solving problems: • Created a User class with properties and methods • Built an Admin class inheriting from User • Added functionality using inheritance and methods ⚠️ Honest reflection: Today felt a bit confusing. I wasn’t very energetic and understanding these concepts took more effort than usual. But I realized: Some topics take time to fully understand It’s okay to feel stuck sometimes Practice is the only way to get clarity Still showing up and learning every day 🚀 #JavaScript #WebDevelopment #100DaysOfCode #Learning
To view or add a comment, sign in
-
30 Days JavaScript Challenge : Day 26 ✅ Today’s problem was about flattening a multi-dimensional array, but with a twist we were given a depth n and had to flatten only up to that level. Not a full flatten, not a shallow one… somewhere in between. It really makes you think about recursion and depth control: When to go deeper When to stop How to keep track of current depth What I liked is how this problem builds intuition around nested data structures something you see a lot in real apps (APIs, configs, UI trees, etc.). Slowly getting more comfortable with recursion and thinking in layers. #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
To view or add a comment, sign in
-
-
What are variables in JavaScript? Variables in JavaScript are used to store data that can be used and updated in your program. They act like containers for values such as numbers, strings, or objects. You can declare variables using let, const, or var. let allows changes, const is for values that shouldn’t change, and var is older and less commonly used. Choosing the right one helps avoid errors. Variables make your code flexible and reusable, allowing you to store user input, perform calculations, and manage data efficiently. #webdeveloper #tech #coding #programming
To view or add a comment, sign in
-
-
30 Days JavaScript Challenge: Day 25 ✅ Today’s problem was about merging two arrays of objects based on a common key (id). Sounds simple at first, but it had a few interesting parts: Handling unique ids Merging objects when ids match Making sure values from the second array override the first Keeping everything sorted It’s actually very close to real-world scenarios like combining data from two APIs or updating existing records with new data. Problems like this make you think more about data handling and structure, not just loops and conditions. Day by day, things are starting to connect better. 🚀 #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic #JavaScriptMastery
To view or add a comment, sign in
-
-
30 Days JavaScript Challenge : Day 24 ✅ Today’s problem was about sorting an array using a custom function. Instead of directly sorting values, we use a function fn to decide the order — basically telling JavaScript how to compare elements. At first it feels simple, but it actually shows how powerful sorting can be when you control the logic: Sorting objects based on a property Sorting nested arrays Custom ranking based on conditions It’s one of those concepts that looks basic but is used everywhere in real projects. Slowly getting more clarity on how to write flexible and reusable logic in JavaScript. #javascript #leetcode #webdevelopment #frontenddeveloper #codingchallenge #learninginpublic #developers #programming #buildinpublic
To view or add a comment, sign in
-
-
What is the difference between let, var, and const? `var`, `let`, and `const` are used to declare variables in JavaScript, but they behave differently. `var` is the older way and has function scope, which can lead to unexpected behavior. It also allows redeclaration and can be updated freely. `let` is block-scoped, meaning it only exists within the block where it’s defined. It can be updated but not redeclared in the same scope, making it safer than `var`. `const` is also block-scoped but cannot be reassigned after it’s declared. It’s used for values that should not change. Overall, `let` and `const` are preferred in modern JavaScript. #webdeveloper #tech #coding #programming
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