Javascript

This in JavaScript

this in JavaScript is an object. Every JavaScript function gets a copy of this (except arrow functions). Its value does not depend on where we declare it but depends on how we invoke it. There are four ways in which we can invoke a function. Function invocation, method invocation, Constructor invocation & Explicit invocation. Each of these invocations will assign different this to the function. In this tutorial, we will dive deep into the this and learn more about it.

This in JavaScript Read More »

Constructor Function & New Operator in JavaScript

Javascript object Constructor function allows us to create multiple similar objects easily. We invoke the constructor function using the new operator. In this tutorial, let us learn what is a constructor function, how to create a constructor, how to create multiple objects using the constructor function, and the role of the new operator in invoking the constructor function.

Constructor Function & New Operator in JavaScript Read More »

Scroll to Top