Is it possible to set an image source on a javascript object property?
<p>Take this piece of code into consideration:</p>

<pre><code>var obj = {
  width : 10,
  height : 10,
  img : new Image(),
  img.src : "assets/img.png" // this is where I get an error
};
</code></pre>

<p>I get an error on <code>img.src</code>. Do I have to set the src afterwards or is there a workaround?</p>