Recently I decided to stop memorizing JavaScript and start understanding how it actually works." 😎 💪 Over the past few days, I’ve been diving deeper into how JavaScript actually works behind the scenes. Instead of just writing code, I started learning what really happens inside the JavaScript engine when our code runs. Here are some of the key concepts I’ve been learning: 🔹 Execution Context Every time JavaScript runs code or a function, it creates an execution context that contains the environment needed to run that code. 🔹 Global Memory vs Local Memory Variables declared globally live in global memory, while variables inside functions live in their own local memory. 🔹 Call Stack JavaScript uses a call stack to keep track of which function is currently running and where execution should return after a function finishes. 🔹 Scope & Variable Lookup When JavaScript looks for a variable, it first checks the current scope, then moves outward to outer scopes until it finds it. 🔹 Closures One of the most interesting concepts so far. A function can remember the variables from the environment where it was created, even after that outer function has finished executing. Understanding these concepts made me realize something important: Writing JavaScript is one thing. Understanding how JavaScript thinks is a completely different level. Still learning, still exploring, and enjoying the process. 🚀 If you're learning JavaScript too, what concept took you the longest to understand? #JavaScript #WebDevelopment #Programming #LearnInPublic #FrontendDevelopment
JavaScript Fundamentals: Execution Context & Beyond
More Relevant Posts
-
Another Day of My JavaScript Mastering Learning Journey DEY WITH ME!!! Today I explored one of the most important concepts in JavaScript: Prototypes. In JavaScript, objects can share properties and methods through something called a prototype. Instead of every object having its own copy of a method, JavaScript stores shared methods on the prototype so multiple objects can reuse them. For example, if we create a constructor like Person, we can add methods to Person.prototype. Every object created from Person will automatically have access to those methods. This approach helps save memory and keep code more efficient, because the methods are shared rather than duplicated for every object. Example idea: Create a constructor (like Person) Add methods to Person.prototype Every instance can use those methods Understanding prototypes helped me see how JavaScript handles inheritance and object behavior under the hood. Small steps like this are helping me build a stronger foundation as I continue learning JavaScript and backend development. #JavaScript #WebDevelopment #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
🚀 Day 89 of My #100DaysOfCode Challenge I thought JavaScript automatically manages memory… so we don’t have to worry about it, right? 🤔 Wrong. Today I learned about something most beginners ignore — Garbage Collection in JavaScript. 💡 What actually happens? JavaScript automatically removes unused memory using something called Garbage Collection. It works on a simple idea: 👉 If something is not reachable, it gets removed from memory. 🧠 Example let user = { name: "Tejal" }; user = null; // now previous object becomes unreachable Now JavaScript will automatically clean this memory. --- ⚠️ But here’s the real problem… Even with automatic memory cleanup, memory leaks can still happen. Some common reasons: • Unused event listeners • Closures holding references • Global variables not cleared --- 💭 What I realized I used to think memory management is not my problem as a developer… But now I understand: 👉 Writing clean code also means not holding unnecessary memory --- JavaScript handles a lot for us… but understanding what’s happening behind the scenes makes a huge difference. Learning something new every day 💻✨ #Day89 #100DaysOfCode #JavaScript #WebDevelopment #CodingJourney #LearningInPublic
To view or add a comment, sign in
-
-
I stopped chasing correct answers in JavaScript today… and started chasing why I was wrong. 👇 --- 💥 Mistakes that taught me more than tutorials: ❌ Thought "onclick" supports multiple handlers 👉 It overrides—use "addEventListener" instead ❌ Confused arrow function "this" 👉 Arrow functions don’t have their own "this" ❌ Expected "var" to behave like "let" 👉 Faced hoisting and scope differences ❌ Assumed async code runs in order 👉 Learned: microtasks run before macrotasks ❌ Misunderstood "await" 👉 It pauses execution and resumes via the microtask queue ❌ Ignored shallow copy behavior 👉 Spread operator copies references, not nested objects --- 💡 Big shift: I wasn’t stuck because JavaScript is hard… I was stuck because I wasn’t questioning why. --- 🎯 What changed: ✔ I analyze outputs instead of guessing ✔ I understand how JS behaves under the hood ✔ I debug with clarity, not confusion --- 📌 Lesson: Mistakes in coding aren’t failures. They’re proof that your understanding is evolving. --- 🚀 Next focus: Closures + real-world problem solving --- If you're learning JavaScript: 👉 Which concept confused you the most? 👉 And what finally made it click? Let’s learn together 👇 #JavaScript #LearningInPublic #Frontend #CodingJourney #Debugging
To view or add a comment, sign in
-
🚀 Day 4 of My JavaScript Learning Journey Today I learned about the building blocks of JavaScript code, which help the JavaScript engine understand and process programs. 📌 Key concepts I explored: • Tokens – The smallest units of code in the source text. • Keywords – Reserved words that have special meaning in JavaScript (like if, for, let, etc.). • Identifiers – User-defined names for variables, functions, or objects. • Literals – Fixed values written directly in the code (like "hello", 42, true). ⚙️ During the parsing phase, the JavaScript engine reads the source code and converts it into a sequence of tokens. These tokens help build the structure of the program and allow the engine to execute it correctly. Step by step, I’m strengthening my understanding of JavaScript fundamentals and how code is processed internally. 💻✨ #JavaScript #WebDevelopment #FrontendDevelopment #CodingJourney #LearningInPublic #DeveloperJourney #ProgrammingBasics
To view or add a comment, sign in
-
-
Day 2 of my JavaScript learning journey. Everyone says: “Just use let and const, never var.” Today I finally understood why. Variables already managed to confuse me once. Here’s what I explored today. Variables in JavaScript: -Variables store data so we can use it later in our program. There are three ways to create them: 1️⃣ var The old way. It’s function-scoped and gets hoisted, which can sometimes cause confusing behavior. 2️⃣ let Modern and block-scoped. You can change the value later. let score = 10; score = 20; 3️⃣ const Also block-scoped, but the value cannot be reassigned. const name = "Shobhit"; One interesting thing I learned: Even if a variable is declared with const, objects inside it can still be modified. Another surprising discovery: typeof null returns "object". This is actually a long-standing JavaScript bug from the early days of the language. It stayed because changing it would break too many websites. My rule going forward: Use const by default. Use let when the value needs to change. Avoid var. Day 2 done. Slowly understanding how JavaScript actually works. What confused you the most when you first learned JavaScript? #JavaScript #LearningInPublic #WebDevelopment #100DaysOfCode #Frontend
To view or add a comment, sign in
-
-
Day 1 🧠 Understanding Lexical Scoping in JavaScript (in 2 minutes) One concept that quietly powers a lot of JavaScript behavior is lexical scoping. 👉 Simply put: A function remembers where it was written, not where it is called. 🔍 Example: let name = "Global"; function print() { console.log(name); } function test() { let name = "Local"; print(); } test(); // Output: Global 💡 Even though print() is called inside test(), it still logs "Global". Why? Because print() was defined in the global scope, so it uses that scope. 🧠 Key Takeaways: Scope is determined at write time (lexical), not run time. JavaScript looks for variables in the scope chain upward. This is the foundation of closures. 🚀 Why this matters: Understanding lexical scoping helps you: ✔ Write predictable code ✔ Debug faster ✔ Master closures, callbacks, and async logic ✔ Work better with React hooks 🔥 One-line takeaway: 👉 "Where you write your function decides what it can access." If you're learning JavaScript fundamentals, don’t skip this — it shows up everywhere. #JavaScript #WebDevelopment #Frontend #Coding #100DaysOfCode
To view or add a comment, sign in
-
🚀 Day 67 of My Coding Journey Today I focused on understanding the fundamentals of JavaScript — what it is, how it works, and why it is essential in web development. 📚 What is JavaScript? JavaScript is a high-level, interpreted programming language used to make web pages interactive and dynamic. 🔹 It runs directly in the browser 🔹 It is one of the core technologies of the web (along with HTML & CSS) 🔹 It is widely used for both frontend and backend development ⚙️ How JavaScript Works: 💡 1. Execution in Browser JavaScript runs inside the browser using a JavaScript Engine (like V8 in Chrome). 💡 2. Single-Threaded Language JavaScript executes code line by line (synchronously) but can handle async tasks. 💻 Topics I Revised: ✅ Variables (var, let, const) ✅ Data Types (Primitive & Non-Primitive) ✅ Operators (Arithmetic, Comparison, Logical) ✅ Conditional Statements ✅ Loops (for, while, do-while) 💡 Key Learnings: ✨ JavaScript is the brain of a website ✨ Understanding how JS works internally is very important ✨ Concepts like event loop & async behavior are crucial ✨ Strong basics = better problem-solving skills #Day67 #JavaScript #CodingJourney #WebDevelopment #LearnInPublic #100DaysOfCode #FrontendDevelopment #10000Coders
To view or add a comment, sign in
-
🚀 Just launched a small project to demonstrate JavaScript library usage and practical examples for developers. While learning or working with JavaScript libraries, one common challenge is finding clear and simple usage examples. Many developers spend time searching documentation just to understand how to integrate a library. So I built a simple demo site that shows how to use JavaScript libraries with real examples. 👉 Explore the project: https://lnkd.in/gg_fU8EB What this project focuses on • Practical examples of using JavaScript libraries • Simple and easy-to-understand implementation • Developer-friendly structure for experimentation • A quick reference for integrating libraries into web projects JavaScript libraries play a huge role in modern web development by helping developers build features faster and reuse tested functionality rather than writing everything from scratch. (arXiv) This project is part of my effort to build useful developer tools and learning resources while exploring new ideas around automation, testing, and developer productivity. If you're a developer, student, or someone exploring JavaScript libraries, I’d love your feedback. Let me know what libraries or examples you would like to see added next. #JavaScript #WebDevelopment #DeveloperTools #Frontend #Programming #Coding #OpenSource #LearningInPublic #BuildInPublic
To view or add a comment, sign in
-
🚀 Day 7/100 of #100DaysOfCode Today was all about strengthening JavaScript fundamentals — revisiting concepts that seem simple but are often misunderstood. 🔁 map() vs forEach() Both are used to iterate over arrays, but they serve different purposes: 👉 map() Returns a new array Used when you want to transform data Does not modify the original array Example: const doubled = arr.map(num => num * 2); 👉 forEach() Does not return anything (undefined) Used for executing side effects (logging, updating values, etc.) Often modifies existing data or performs actions Example: arr.forEach(num => console.log(num)); ⚔️ Key Difference: Use map() when you need a new transformed array Use forEach() when you just want to loop and perform actions ⚖️ == vs === (Equality in JS) 👉 == (Loose Equality) Compares values after type conversion Can lead to unexpected results Example: '5' == 5 // true 😬 👉 === (Strict Equality) Compares value AND type No type coercion → safer and predictable Example: '5' === 5 // false ✅ 💡 Takeaway: Small concepts like these make a big difference in writing clean, bug-free code. Mastering the basics is what separates good developers from great ones. 🔥 Consistency > Intensity On to Day 8! #JavaScript #WebDevelopment #CodingJourney #LearnInPublic #Developers #100DaysOfCode #SheryiansCodingSchool #Sheryians
To view or add a comment, sign in
-
-
Day 4 of my JavaScript learning journey. Today I learned one of the most confusing concepts so far: Hoisting. I tried something strange. greet(); function greet() { console.log("Hello!"); } The function worked even before it was defined. That’s because of hoisting. JavaScript reads the whole code first and moves function declarations to the top internally. But variables behave differently. console.log(x); var x = 5; This prints undefined, not 5. And if we use let or const, JavaScript throws a ReferenceError. This area is called the Temporal Dead Zone. My takeaway today: Always declare variables before using them. Day 4 done. JavaScript keeps getting more interesting. What JavaScript concept confused you the most when you first learned it? #JavaScript #LearningInPublic #WebDevelopment #100DaysOfCode #Frontend
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