Category: JavaScript
-
undefined and null in JavaScript
Have they ever asked you? “Can you explain null and undefined in JavaScript?” This question is very trivial but important. As a JavaScript developer, you must have absolute understanding on undefined and null. Let us start by looking at code below: This file contains bidirectional Unicode text that may be interpreted or compiled differently than…
-
How to create a Class in JavaScript
Have they ever asked you that “How you create class in JavaScript?” I am sure, regardless level of JavaScript interview; you must have come across this question. Well, there is no one answer of this question. However, before you go ahead and read detailed answer in this post, let me give you a gist in…
-
How to create constants in JavaScript?
Constants are immutable variables which value cannot be changed. Once, you have created a constant, its value cannot be changed. While coding in JavaScript, many times you may have come across a requirement to create constants. Before ECMA Script 6, it was not very easy to create constants in JavaScript. In this post, I will…
-
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…