Category: JavaScript
-
11 things about JavaScript functions .NET developers must know: Part 1
I have often seen .NET developers struggle with the JavaScript. They try to compare C# functions with the JavaScript functions and usually do some minor but conceptual mistakes while using it. As we all will agree that JavaScript functions are the backbone of the JavaScript programming language, and if one has good understanding of the…
-
Getting started with Unit Testing JavaScript using QUnit
It is good to have automated unit tests for the codes while developing. In unit test we test smallest unit of the code for a particular behaviour. The Unit test helps us to find bugs in the code early in the development cycle. Essentially unit test is the piece of code which verifies behaviour of…
-
Prototypical inheritance in JavaScript
Read full post on falafel blog Before we can understand prototypical inheritance, let us start with a problem statement. You have a student for whom you need to: Calculate their grade Print the grade In JavaScript this can be simply implemented as follows: There are some inherent problems in the above approach: Variables are defined…
-
== and === operators of JavaScript in simple words
There are astronomical articles and blog posts have been written on == and === operators in JavaScript but I had tough time understanding it. So I decided to write my learning in this blog post. I will try to explain == and === in simplest words. To start with try to understand difference between these…
-
JavaScript Functions is a Statement or Expression?
Answer of above question is JavaScript functions can be used either as statement or expression. JavaScript functions can be treated in different ways. They can be Expression Passed as value Returned as value Statement Functions in JavaScript can be Expression or Statement. Problem is in both flavour they look exactly same. So a function statement…
-
How to setup JavaScript Build in Sublime Text 2
Yes I am turning friend of Sublime Text and thought to use Sublime for JavaScript development as well. To execute JavaScript in Sublime, you need to create new Build System for JavaScript. There are two steps you need to follow, Install Node.js Create new build system for JavaScript To install Node navigate to http://nodejs.org/ and…
-
Revealing Module Pattern in JavaScript
We talked about Prototype Pattern in previous posts. You can read them at below link. Understanding Prototype Pattern in JavaScript Understanding Prototype Pattern in JavaScript: Part # 2 Revealing Module Pattern allows us to achieve Singleton object Private Public behaviour of functions and properties in the object. Let us consider the usual code we write.…
-
Understanding Prototype Pattern in JavaScript: Part # 2
Recently we had a look on Understanding Prototype Pattern in JavaScript. I tried to explain this pattern in most simplified way. In this post we will get more dipper and see how prototype works in JavaScript. Putting it in simple words in prototype pattern, we create object using template of an existing object. In prototype…
-
Understanding Prototype Pattern in JavaScript
I am writing this blog post from Bulgaria Sofia. I am here to attend Devreach conference organised by Telerik . In conference I had an opportunity to meet my great inspiration Dan Wahlin . I attended his session on “Patterns in JavaScript” and I must say it was one of the best technical session I…
-
Variable Scope Chain in JavaScript
Before you start reading this post I recommend you to read Variable Scoping and Hoisting in JavaScript . In this post we will take a look on Scope Chain in JavaScript. Let us consider you have declare a variable globally as below, In above code variables are declared globally, in other words they are not…