I'm pretty new to JavaScript.
I'm trying to define my custom errors, but it doesn't seems to be working
function MyError(msg){
this.message = msg
this.name = "My Error"
}
body.onload = function(){
try{
er = new MyError("Test Message")
throw er();
} catch(e) {
alert(e.name + ": " + e.message);
}
}
Getting TypeError, claiming that it's not a function.