Throwing user defined error in javascript
<p>I am trying to throw an exception in javascript, I am trying to give exception a number along with the message, but i am only getting the message alone and not the number why? what am i doing wrong?
my code is:</p>

<pre><code>function ain()
{
    var e = new Error("hello guys" ,12345);
    throw e;
}

(function() {
    try {
       ain();
    }
    catch(e) {
        alert(e.number+"     "+e.message);
    }
}());
</code></pre>

<p>The output is :</p>

<pre><code>undefined     hello guys
</code></pre>
