Why use new.target inside a function in JavaScript – Simplified

There are four invocation patterns in JavaScript, which means you can call a function in four possible ways. They are, Function Invocation PatternConstructor Invocation PatternMethod Invocation PatternIndirect Invocation Pattern Essentially, these four-invocation patterns determine the value of ‘this’ object inside a function.  Let us consider the function created below, function add(num1, num2) {     console.log(this); // global object  } let a = add(8, 9);  In the … Continue reading Why use new.target inside a function in JavaScript – Simplified