🚀 Understanding How JavaScript Actually Runs Behind the Scenes Today in college, I learned something that completely changed how I look at JavaScript execution. We often write code like this: var x = 10, y = 20; function add(x, y) { var res = x + y; return res; } console.log(add(x, y)); But what actually happens inside the JavaScript Engine? Here’s the simplified breakdown: 🧠 Step 1: Creation Phase (Memory Phase) JS scans the entire code first Variables are allocated memory and initialized with undefined Functions are stored in memory with their complete body ⚙️ Step 2: Execution Phase (Code Phase) Code runs line by line Variables get actual values Function is invoked A new execution context is created The Call Stack manages everything Understanding: Execution Context Memory Creation Code Execution Call Stack …makes JavaScript feel much more logical instead of “magic”. The output is simple: 30 But the process behind it is powerful. 📚 Currently diving deeper into JavaScript fundamentals as part of my B.Tech journey. #JavaScript #WebDevelopment #Programming #LearningInPublic #ComputerScience #FrontendDevelopment
JavaScript Execution: Creation & Execution Phases Explained
More Relevant Posts
-
🚀 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 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
-
-
⭐ Learning JavaScript by Building Projects Recently, I’ve been focusing on strengthening my JavaScript fundamentals, and I built a simple Bat Ball Stump game to practice core concepts. Instead of just watching tutorials, I wanted to apply what I learned in a small working project. Through this project, I practiced: 🔹 Variables and data types 🔹 Functions and function calls 🔹 Conditional statements (if–else logic) 🔹 Random number generation 🔹 Objects to manage score 🔹 DOM manipulation to update results dynamically 🔹 LocalStorage to persist data One interesting part was managing and updating the score object correctly and resetting it without breaking the logic — small bugs there taught me a lot about how JavaScript actually behaves. This project reminded me that mastering basics is powerful. Clean logic > complex code. Currently continuing to explore deeper concepts and building more small projects alongside.⭐ #JavaScript #WebDevelopment #LearningJourney #FrontendBasics #CodingPractice
To view or add a comment, sign in
-
🚀 Day 86 of My #100DaysOfCode Challenge Today I discovered a lesser-known feature in JavaScript — Symbols. Most developers work with object keys using strings, but JavaScript also provides another unique type called Symbol. A Symbol creates a unique and hidden property key that cannot accidentally conflict with other keys. Example const id = Symbol("id"); const user = { name: "Tejal", [id]: 12345 }; console.log(user.name); // Tejal console.log(user[id]); // 12345 Why Symbols are interesting • Every Symbol is unique • Helps create hidden object properties • Prevents accidental property overwriting • Often used internally in libraries and frameworks Even if two symbols have the same description, they are still different. const a = Symbol("key"); const b = Symbol("key"); console.log(a === b); // false Learning about features like Symbols helps me understand how JavaScript works behind the scenes and how large applications manage object data safely. Exploring deeper concepts every day. 💻✨ #Day86 #100DaysOfCode #JavaScript #WebDevelopment #LearningInPublic #CodingJourney
To view or add a comment, sign in
-
-
Last night’s cohort session was highly productive and insightful. We explored one of the most important concepts in JavaScript — Promises — and understood how asynchronous operations work behind the scenes. I learned how to properly use: Promise .then() for handling successful responses .catch() for handling errors One important concept we learned in more depth was that error handling is not limited to .catch() only. We can also handle errors inside .then() by passing a second callback function. Along with that, we understood that multiple .then() and .catch() methods can be chained together, which helps manage complex asynchronous flows in a clean and structured way. Understanding these concepts is helping me build a stronger foundation in JavaScript, especially for real-world applications where APIs and async operations are involved. We also completed quizzes to test our understanding and had a live discussion session that cleared many practical doubts. The interactive conversation made the learning experience even more impactful.
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
-
-
🚀 Day 31–36 of #100DaysOfCode (Catch-up Update) Over the last few days I focused on strengthening my JavaScript fundamentals and problem-solving skills. Topics Covered JavaScript Core Concepts 🔹 this keyword 🔹 Try & Catch (Error Handling) 🔹 Arrow Functions & Implicit Return 🔹 setTimeout() and setInterval() 🔹 Function Expressions 🔹 Higher Order Functions Functions & Scope 🔹 Functions with Arguments 🔹 Return Keyword 🔹 Scope (Block & Lexical Scope) Objects in JavaScript 🔹 Object Literals 🔹 Nested Objects 🔹 Array of Objects 🔹 Math Object 🔹 Random Number Generation 🔹 Built a small Guessing Game Loops & Logic Building 🔹 for loops & while loops 🔹 Nested loops 🔹 break keyword 🔹 Loops with arrays Arrays & Methods 🔹 Array Data Structure 🔹 Array Methods 🔹 indexOf() & includes() 🔹 slice(), splice() 🔹 Concatenation & Reverse Mini Project 🔹 Built a simple Todo App using JavaScript Missed posting updates for a few days, but the learning continued. Still moving forward with the challenge and keeping the momentum. Consistency over perfection. 💻🔥 #100DaysOfCode #JavaScript #WebDevelopment #LearningInPublic #CodingJourney
To view or add a comment, sign in
-
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
-
📌 LinkedIn Post Content 🚀 30 Days of JavaScript – Day 7 Continuing my journey of improving JavaScript logical thinking by solving small problems daily. 💡 Today’s Program: Remove Duplicate Numbers from an Array This program takes numbers as input and removes duplicate values to create a list of unique numbers. 🧠 Concepts Used: • Arrays • split() and map() • includes() method • for loop • Conditional logic Example: Input → 1,2,3,2,4,1,5 Output → [1,2,3,4,5] 🎥 Demo below 👇 Full source code in the First comment. #JavaScript #CodingJourney #ProblemSolving #WebDevelopment #LearningJavaScript
To view or add a comment, sign in
-
🚀 Just solved the "Best Time to Buy and Sell Stock" problem in JavaScript! Today I worked on improving my problem-solving skills by implementing a solution to calculate the maximum profit from stock prices. 🔍 Problem: Given an array of prices, determine the maximum profit you can achieve by buying and selling once. 💡 Approach: I started with a brute-force solution using nested loops to compare every possible buy/sell pair. While not the most optimal (O(n²)), it helped me deeply understand the problem before optimizing. 📌 Example: Input: [10, 1, 5, 6, 7, 1] Output: 6 🧠 Key takeaway: Sometimes starting simple is the best way to build strong intuition before moving to more efficient solutions. 👉 Check out my code and more JavaScript patterns here: https://lnkd.in/ej4fNeZs #JavaScript #Coding #ProblemSolving #100DaysOfCode #WebDevelopment #LearningInPublic
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
Great bro 👍