Javascript - can you throw an object in an Error? : <p>Is it possible to throw an object using Error? In the example below the console shows <code>undefined</code>.</p>

<pre><code>try {
    throw Error({foo: 'bar'});
} catch (err) {
    console.log(err.message.foo);
}
</code></pre>
