title: How to evaluate javascript variable inside jQuery append?
body: <p>I have an array of objects (<code>array</code>), each with a property containing a URL string that routes to an image. I am trying to use jQuery to loop through this array and append each object's image into a <code>div</code>. Here is my code:</p>
  
  <pre><code>for (var i = 0; i &lt; array.length; i++) {
      $('#div').append("&lt;img src=\"array[i].URL\" alt=\"pic\"&gt;");
  }
  </code></pre>
  
  <p>Note: I used the backslashes to escape the quotes in the img tag. </p>
  
  <p>The javascript is not evaluating inside the <code>append</code> method and it is simply printing "array[i].URL" for the image address on the page.</p>
  
  <p>Can someone give me a heads-up on what I'm doing wrong here?</p>