Category: JavaScript
-
How to print or enumerate properties of a JavaScript object?
I usually come across the following requirements, How to print name of all the properties of an object? How to print only the methods of an object? How to print even non-enumerable properties of an object? In this post, we will explore all the options to iterate and print properties of a JavaScript object. Let […]
-
What are Closures in JavaScript?
Read full article on the Infragistics Blog A JavaScript closure is a function which remembers the environment in which it was created. We can think of it as an object with one method and private variables. JavaScript closures are a special kind of object which contains the function and the local scope of the function […]
-
Simplifying Objects, Inheritance and prototype in JavaScript
This blog post explains about Objects, Inheritance and Prototype in JavaScript
-
Getting started with TypeScript
TypeScript is superset of JavaScript created by Microsoft. TypeScript – according to its website – “lets you write JavaScript the way you really want to. TypeScript is a typed superset of JavaScript that compiles to plain JavaScript”. Some features of TypeScript include: Support standard JavaScript Static typing Encapsulation using the classes and the modules Constructors, […]
-
Simplifying the JavaScript Callback function for .NET developers
In JavaScript, functions are objects, and they can: Be passed as an argument to another function Return as a value from a function Be assigned to a variable Let’s assume that you have a JavaScript function (let’s call it function A) with the following properties: Function A takes another function (let’s call this one function […]
-
Objects in JavaScript for .NET developers – Part 1
Read full article on the Infragistics blog Here are some fun facts for you: JavaScript is not an object oriented language, but almost everything in JavaScript is an object. JavaScript does not have classes, and we can create an object from an object. A function can be used as a constructor, and returns a newly […]
-
11 things about JavaScript functions that .NET developers should know: Part 2
Read full article on the Infragistics blog This is the second part of the series in 11 Things about JavaScript Functions that .NET Developers Should Know . In part 1 we discussed the following topics, JavaScript functions as an expression JavaScript functions as a statement Return statements in JavaScript functions Parameters in JavaScript functions The […]
-
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 […]