I am a beginner and getting started with JavaScript, so recently I came across this code and I am really confused as the keyword 'new' in JavaScript is used alongside a constructor function to create a new empty object. Error("Error") isn't a function, still I am successfully able to run this lines of code
let a=new Error("Error")
console.log(a)
I tried researching from my end and look everywhere where I can, but I cant seem to find a satisfactory answer to resolve my doubt