when i want to send and Error using Javascript i do:

> 
> throw new Error()
> 
> 
> 

it works, but if i pass a number, example:

> 
> throw new Error(500)
> 
> 
> 

The result is:

> 
> Error: 500
> 
> 
> 

Where 'Error: ' is a string. 

I have a function that handle this errors, this function must to know the code of the error, how to retrieve it? Do i have to parse the string? :-(

Thank you.