Limitations: No Prototype and new.target Property
Learn about the limitations of arrow functions, specifically how they lack the prototype property and the new.target property.
new.target
is lexically scoped
Functions may use new.target
to determine if they were called as a constructor or as a regular function.
For non-arrow functions
In the following code, we use the new.target
property to check how the function was called.
Get hands-on with 1400+ tech skills courses.