Question
What happens if you try to call a regular function as if it were a constructor function?
Asked by: USER1738
88 Viewed
88 Answers
Answer (88)
If you call a regular function with the `new` keyword, JavaScript will throw a `TypeError`. It expects a constructor function, not a regular function, when `new` is used. This is a crucial distinction to avoid unexpected behavior.