function declaration wins or variable declaration in JavaScript Hoisting

If you have a variable and a function declared with the same name, then which has a precedence over each other in the hoisting ? This video explains that. In JavaScript function and variable declarations are hoisted at the top of the execution context. You need to remember these three rules for on the same. … Continue reading function declaration wins or variable declaration in JavaScript Hoisting

Master JavaScript ‘this’ in 30 Mins

Do you know, there are four ways to calculate the value of 'this' inside a JavaScript function?  Some pointers about 'this'  Every function has it's own 'this' An arrow function does not have it's own 'this'The value of 'this' depends on, how that function is called. The value of 'this does not depend on how the function … Continue reading Master JavaScript ‘this’ in 30 Mins

JavaScript function is also a constructor?

JavaScript function is also a “constructor.” You must have heard it many times, haven’t you? Well, that is a wrong way of interpreting the JavaScript function; even though you can create an object using a function, it does not mean you can call it a constructor. Let us discuss it: There are four ways to … Continue reading JavaScript function is also a constructor?

Angular Interview : is Angular Service Singleton ?

One of the most popular Angular interview questions is, whether a service is singleton? By default, when you create a service using the below CLI command, ng g s app AppService is singleton, however it can be re-provided to create more objects of it. Say, you again re provide AppService in one of the components, … Continue reading Angular Interview : is Angular Service Singleton ?

Closures in JavaScript: Video

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 with all the variables (environment) when the … Continue reading Closures in JavaScript: Video

Joined MongoDB

I am very excited to inform you all that I have joined esteem MongoDB starting 5th October 2020.  I have joined the Professional Services Team and will be working from Gurgaon, India. At MongoDB, my primary responsibility is to work closely with engineers and make a world-class training curriculum for them and our customers.  I … Continue reading Joined MongoDB

Union and Intersection of types in TypeScript

Do you know, TypeScript allows union and Intersection of types? Why you need that? Let us assume you need to create a function that checks whether the passed value is boolean true and returns true, otherwise returns null. That function may look like below, function trueOrNull(foo: any): any {     if (foo === true) {         return true;     }     return undefined; } console.log(trueOrNull(88)); // null  As you see, the … Continue reading Union and Intersection of types in TypeScript

Recognized as Progress Ninja

I am very excited to share that I have been recognized as Progress Ninja by Progress Telerik. Thanks,  Progress Telerik, for recognizing me as one of the Progress Ninja. I am happy and excited to work with the Progress developer community and developer community in general. As of now, there are six Progress Ninjas, … Continue reading Recognized as Progress Ninja