Category: JavaScript
-
Get it right: null and undefined in JavaScript
Well, whenever I talk to developers, I find them in confusion about null and undefined in JavaScript. In this post I try to simplify understanding of null and undefined in JavaScript. To start with null is language keyword and undefined in value of a variable. Both evaluates to value that indicates absence of a value. […]
-
Variable Scoping and Hoisting in JavaScript
Variable Scoping in JavaScript is quite different than other programming languages like C. In this post we will learn variable scoping in JavaScript. Simply putting, Scope of a JavaScript variable is within region of the program it is defined. So a variable defined inside function will have scope inside that function. Consider following code snippet, […]
-
Invocation patterns in JavaScript
In JavaScript you can invoke a function in four different ways. In this post we will take a look on various invocation patterns. There are four ways a function can be invoked in JavaScript. Four invocation patterns in JavaScript are as follows, Function Invocation Pattern Method Invocation Pattern Constructor Invocation Pattern Indirect Invocation Pattern Function […]
-
What is Method Invocation Pattern in JavaScript
In this post we will take a look on “Method Invocation Pattern” in JavaScript. In JavaScript when function is defined as property of object then it is known as Method Assume we have a JavaScript object as following. In studentObject object property findgrade is a function. So we can say findgrade is a method. Invocation […]
-
How to find index of an item in JavaScript Object Array?
Recently while working I came across a scenario. I had to find index of a particular item on given condition from a JavaScript object array. In this post we will see how to find index of object from JavaScript array of object. Let us assume we have a JavaScript array as following, Now if we […]
-
What is JSON?
For some of you this question might be the easiest to answer. But for many developers concept of JSON is not well understood. In my seminars when I use JSON data for demo, I find many developers do not have understanding of JSON. In this post I am trying to address this problem. In simple […]
-
What is strict mode in JavaScript?
Have you ever noticed use of strict keyboard as shown in following image anywhere? When I start creating application for Windows Store (Metro App), I noticed this on the top of the default.js file. Well it is nothing but a way to tell JavaScript for better coding and error checking in JavaScript code. If […]