February 2018
Intermediate to advanced
298 pages
8h 22m
English
The default value of new.target is undefined, but when a function is invoked as a constructor, the value of the new.target parameter depends on the following conditions:
Inside an arrow function, the value of new.target is the same as the value for the new.target of the surrounding non-arrow function.
Here is example code to demonstrate this:
function myConstructor() { console.log(new.target.name); } class myClass extends myConstructor { constructor() ...Read now
Unlock full access