My FeedDiscussionsHeadless CMS
New
Sign in
Log inSign up
Learn more about Hashnode Headless CMSHashnode Headless CMS
Collaborate seamlessly with Hashnode Headless CMS for Enterprise.
Upgrade ✨Learn more

What is the significance of `new` keyword in javascript?

Rahul Kumar Borah's photo
Rahul Kumar Borah
·Aug 5, 2020·

1 min read

What is the difference between the following two statements?

Statement 1:

throw Error("some error message");

Statement 2:

throw new Error("some error message");