new.target
using new.target inside constructors
After the introduction of new.target
for classes in Chapter 4, you will now understand it more deeply by using the same language construct for functions.
You can retrieve the constructor function of an object inside the constructor by using new.target
.
Level up your interview prep. Join Educative to access 80+ hands-on prep courses.