JavaScript OOP Concepts with Hitesh Choudhary

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

  • text

To view or add a comment, sign in

Explore content categories