<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Akhil Ankathi</title>
    <description>The latest articles on DEV Community by Akhil Ankathi (@akhil_ankathi_982a968674c).</description>
    <link>https://dev.to/akhil_ankathi_982a968674c</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4260776%2F49c04b1c-913f-4e9e-93ec-ccfa5f96480f.jpg</url>
      <title>DEV Community: Akhil Ankathi</title>
      <link>https://dev.to/akhil_ankathi_982a968674c</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/akhil_ankathi_982a968674c"/>
    <language>en</language>
    <item>
      <title>Understanding JavaScript Beyond Just Writing Code 🚀</title>
      <dc:creator>Akhil Ankathi</dc:creator>
      <pubDate>Mon, 23 Nov 2026 14:17:01 +0000</pubDate>
      <link>https://dev.to/akhil_ankathi_982a968674c/understanding-javascript-beyond-just-writing-code-481j</link>
      <guid>https://dev.to/akhil_ankathi_982a968674c/understanding-javascript-beyond-just-writing-code-481j</guid>
      <description>&lt;h1&gt;
  
  
  Understanding JavaScript Beyond Just Writing Code 🚀
&lt;/h1&gt;

&lt;p&gt;Whenever we start learning something new, whether it's a programming language, a technology, a tool, or even something completely unrelated to technology, I believe there's one important thing we should do first:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Understand how it actually works behind the scenes.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Think about it.&lt;/p&gt;

&lt;p&gt;When you're learning how to drive a car, you don't just memorize which button to press or which pedal to use. Eventually, you become curious about how the engine works, how the gears function, and what happens when you accelerate or apply the brakes.&lt;/p&gt;

&lt;p&gt;That understanding gives you a much clearer picture of what you're doing and why you're doing it.&lt;/p&gt;

&lt;p&gt;I believe the same approach applies to JavaScript.&lt;/p&gt;

&lt;p&gt;Most of us start learning JavaScript by writing functions, working with variables, handling events, using promises, and building applications.&lt;/p&gt;

&lt;p&gt;But have we ever stopped and asked:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;What actually happens when a JavaScript function is called?&lt;/li&gt;
&lt;li&gt;Where are variables stored?&lt;/li&gt;
&lt;li&gt;How does JavaScript know which function to execute?&lt;/li&gt;
&lt;li&gt;What happens to local variables when a function finishes?&lt;/li&gt;
&lt;li&gt;How does JavaScript manage multiple function calls?&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Let's start exploring these questions by understanding one of the most important JavaScript concepts.&lt;/p&gt;

&lt;h2&gt;
  
  
  🧠 JavaScript Execution Context
&lt;/h2&gt;

&lt;p&gt;An &lt;strong&gt;Execution Context&lt;/strong&gt; is the environment in which JavaScript code is evaluated and executed.&lt;/p&gt;

&lt;p&gt;Whenever JavaScript runs code, it creates an execution context to manage everything needed for that execution.&lt;/p&gt;

&lt;p&gt;Let's understand this with a simple example.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Akhil"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kd"&gt;var&lt;/span&gt; &lt;span class="n"&gt;message&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s2"&gt;"Hello"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;message&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What exactly happens when JavaScript executes this code?&lt;/p&gt;

&lt;h3&gt;
  
  
  1. Global Execution Context
&lt;/h3&gt;

&lt;p&gt;When JavaScript starts executing a program, it creates something called the Global Execution Context (GEC).&lt;/p&gt;

&lt;p&gt;Think of it as the main workspace where JavaScript starts managing your program.&lt;/p&gt;

&lt;p&gt;It has two important phases:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Creation Phase:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Memory is allocated for variables and functions.&lt;/li&gt;
&lt;li&gt;Variables declared with &lt;code&gt;var&lt;/code&gt; are initialized with &lt;code&gt;undefined&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Function declarations are stored with their complete function definitions.&lt;/li&gt;
&lt;li&gt;The global &lt;code&gt;this&lt;/code&gt; value is established.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Execution Phase:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;JavaScript executes the code line by line.&lt;/li&gt;
&lt;li&gt;Variables receive their actual values.&lt;/li&gt;
&lt;li&gt;Function calls are executed when encountered.&lt;/li&gt;
&lt;/ul&gt;

&lt;h3&gt;
  
  
  2. Function Execution Context
&lt;/h3&gt;

&lt;p&gt;Now comes the interesting part!&lt;/p&gt;

&lt;p&gt;When JavaScript encounters:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nf"&gt;greet&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It creates a new Function Execution Context for the &lt;code&gt;greet()&lt;/code&gt; function.&lt;/p&gt;

&lt;p&gt;This context manages:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Local variables.&lt;/li&gt;
&lt;li&gt;Function parameters.&lt;/li&gt;
&lt;li&gt;The function's lexical environment.&lt;/li&gt;
&lt;li&gt;Its outer environment reference.&lt;/li&gt;
&lt;li&gt;The value of &lt;code&gt;this&lt;/code&gt; (depending on how the function is called).&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;When the function executes, JavaScript accesses the variables available inside its own scope and, when necessary, looks up the scope chain to find variables in outer environments.&lt;/p&gt;

&lt;h3&gt;
  
  
  3. Call Stack — How JavaScript Tracks Function Execution
&lt;/h3&gt;

&lt;p&gt;But how does JavaScript keep track of which function is currently running?&lt;/p&gt;

&lt;p&gt;That's where the Call Stack comes in.&lt;/p&gt;

&lt;p&gt;Think of it like a stack of plates.&lt;/p&gt;

&lt;p&gt;You remove the last plate you placed on top first.&lt;/p&gt;

&lt;p&gt;JavaScript follows the same Last In, First Out (LIFO) principle.&lt;/p&gt;

&lt;p&gt;For example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;second&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;second&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nf"&gt;third&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="kd"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;third&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nb"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;"JavaScript is interesting!"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nf"&gt;first&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Execution flow:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Global Execution Context is created.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;first()&lt;/code&gt; is called and pushed onto the stack.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;second()&lt;/code&gt; is called and pushed onto the stack.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;third()&lt;/code&gt; is called and pushed onto the stack.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;third()&lt;/code&gt; finishes and is removed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;second()&lt;/code&gt; finishes and is removed.&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;first()&lt;/code&gt; finishes and is removed.&lt;/li&gt;
&lt;li&gt;Finally, the Global Execution Context remains until the program finishes.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This is how JavaScript manages function execution.&lt;/p&gt;

&lt;h3&gt;
  
  
  Why should we understand this?
&lt;/h3&gt;

&lt;p&gt;Because these concepts are the foundation for understanding many other JavaScript topics:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Hoisting&lt;/li&gt;
&lt;li&gt;Scope and Scope Chain&lt;/li&gt;
&lt;li&gt;Lexical Environment&lt;/li&gt;
&lt;li&gt;Closures&lt;/li&gt;
&lt;li&gt;
&lt;code&gt;this&lt;/code&gt; keyword&lt;/li&gt;
&lt;li&gt;Event Loop&lt;/li&gt;
&lt;li&gt;Asynchronous JavaScript&lt;/li&gt;
&lt;li&gt;Callbacks and Promises&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Instead of simply memorizing definitions, understanding what happens internally makes it easier to debug code, understand unexpected behavior, and write better applications.&lt;/p&gt;

&lt;p&gt;What's coming next?&lt;/p&gt;

&lt;p&gt;I'm planning to explore JavaScript internals one concept at a time, with practical code examples, execution flow, visual explanations, and real-world scenarios.&lt;/p&gt;

&lt;p&gt;I'll also add these detailed explanations to our Frontend Learning Hub, so developers can learn not just how to write code, but how JavaScript works under the hood.&lt;/p&gt;

&lt;p&gt;Because there's a big difference between knowing how to use something and understanding how it works.&lt;/p&gt;

&lt;p&gt;Let's learn JavaScript beyond the syntax! 🚀&lt;/p&gt;

&lt;h1&gt;
  
  
  JavaScript #WebDevelopment #FrontendDevelopment #JavaScriptInternals #ExecutionContext #FrontendLearning #LearnInPublic
&lt;/h1&gt;

</description>
      <category>programming</category>
      <category>productivity</category>
      <category>javascript</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
