Check if Called with new

Detect whether a function was invoked as a regular function call or as a constructor with the new keyword.

Asked in frontend interviews at Google, Microsoft and TikTok