JavaScript Execution – II

To read the part 1 of this post, click here. Simple function expression Let’s take this example: I have created foo variable before assigning a value to keep the execution simple. Let’s go through the two phase execution for this piece of code. Phase 1: Line 1: New variable foo, allocate memory for foo. Line 2:

Read More


JavaScript Execution – I

JavaScript is an interpreted language. It means, it is executed line-by-line, and if there is an error at line 10 of the code, rest of the code (line 11 onwards) will never be executed. Even all other unrelated codes will also not execute if the JavaScript engine fails at a point and they come next

Read More


Functions in JavaScript

Everything in JavaScript is an Object. As we discussed in the previous post, JavaScript even treats the primitive data types as objects to provide additional functionality. Click here to see the example. Every programming language has functions, and a function is a reusable set of instructions. Apart from this, functions create their own scope. So

Read More