DEV Community

Cover image for Day 13: Deep Dive into Object Properties, Getters & Setters, and Lexical Scope in JavaScript 🎉
Rohit-1301
Rohit-1301

Posted on

Day 13: Deep Dive into Object Properties, Getters & Setters, and Lexical Scope in JavaScript 🎉

Hello Dev Community!

Today marks the 13th day of my 21-day JavaScript learning challenge, inspired by the amazing Hitesh Choudhary from the "ChaiAurCode" YouTube channel. 📚✨ Each day brings new insights and practical knowledge, and today was no exception. Let's dive into what I learned today!

Object Properties: Writable, Enumerable, and Configurable 🚀
The day started with a fascinating exploration of how to define properties in an object. I learned about the writable, enumerable, and configurable attributes and how they control the behavior of object properties. It's intriguing to see how these attributes can make properties read-only or hide them from enumeration.

One of the key takeaways was understanding that some properties of built-in objects can't be overwritten, even if you change their attributes. This helps maintain the integrity and security of built-in functionalities. 🛡️

Getters and Setters: Enhancing Object Interactions 🔄
Next, I delved into getters and setters in JavaScript. These special methods allow us to get and set the values of object properties dynamically. Through various program implementations, I saw how getters can encapsulate and protect property values, while setters can provide validation logic before updating values. This feature adds a layer of abstraction and control to our objects, making our code more robust and maintainable. 🏗️

Lexical Scope and Closures: Unveiling JavaScript's Inner Workings 🧩
Finally, I explored lexical scope and closures, two fundamental concepts in JavaScript. Understanding lexical scope clarified how variable accessibility is determined by the function's physical location in the source code. Closures, on the other hand, revealed how functions can retain access to their lexical scope even after the outer function has finished execution. This concept is particularly powerful for creating private variables and encapsulated states in JavaScript. 🔒

Let's Connect! 🌐
I'm documenting all my code and programs from this challenge on my GitHub repo. Feel free to check it out and see my progress! Also, connect with me on LinkedIn to follow my journey and share your insights.
Linkedin link:-www.linkedin.com/in/rohit-gupta-687b9829a
Github repo:-https://github.com/Rohit-1301/21-day-Javascript/tree/main/Day%2013%20of%20Javascript

Recommendations and Future Plans 🎯
If you're looking to learn JavaScript, I highly recommend following the "ChaiAurJavaScript" playlist by Hitesh Choudhary on YouTube. His teaching style is engaging and easy to follow. 🎥
Playlist Link:-https://youtube.com/playlist?list=PLu71SKxNbfoBuX3f4EOACle2y-tRC5Q37&si=0-pj9KeaFaCCtnaQ

From the past 13 days of learning JavaScript through various programs and language features, I've gained a solid foundation. Next up, I'll be working on some exciting projects to further hone my JavaScript skills. Stay tuned for more updates and insights! 🚀

Thank you for reading, and happy coding! 💻✨

Top comments (0)