Posts

What happens when you run java script programm?

Image
As you know when you run the java script program everything will happen inside the Execution Context as we discussed in the  article . Java script execution is not possible without the execution context. When you run a java script program the execution context will be created. Suppose we have following line of code to execute like. var n=2; function cube(number) { var result=number*number*number; return result; } var cubeof4=cube(4); var cubeof6=cube(6); When you run this program a global execution context will be created.  The execution context will be created in two phases. 1) Creation Phase Or Memory Creation Phase. 2) Code Execution Phase. What will happen in the First Phase/Creation Phase/Memory Execution Phase? In the first phase first of all java script will allocate the memory to all the variables and functions.  It will allocate the memory to all the variables and allocate a special value 'undefined'. It will allocate the memory to the function 'cube'. You can ...

How Java Script Works Internally

Image
I am creating this java script article series for the developers who works in backend or any other technologies but they want to learn the frontend also to become a full stack developer. Because now a days if we want to survive and grow in the market we should know both the frontend and backend. And the frontend starts with java scripts in the beginning of my carrier I knew how to write the code in java script/jQuery but I did not knew how its executes internally. So with the help of these articles I will try to explain how java script works and what are the things behind the scene. And I hope these articles will be very helpful for you and will clear all the doubts regarding the java script. How Java Script Works Internally? In this article we will talk about: How Java Script works? How Java Script executes? Is Java Script Synchronous/Asynchronous? Is Java Script Single Threaded/Multi Threaded. Note:-Everything in the java script happens inside the execution context. What is Execution...