title: Copy a 2-dimensional pixel array to a Javascript canvas
body: <p>Using the Javascript canvas element, is it possible to copy a 2-dimensional array of RGB values to a canvas?</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;canvas id="canvas" height="200" width="200"&gt;&lt;/canvas&gt;
  &lt;script type = "text/javascript"&gt;
  
  //copy the following array to the canvas:
  var arr1 = [
  [[255, 255, 255],[200, 200, 0],[200, 200, 200]],
  [[200, 0, 0],[200, 200, 0],[200, 200, 0]],
  [[200, 200, 0],[200, 0, 0],[200, 200, 0]]
  ]
  
  &lt;script&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>