title: Sort Array based on Object Attribute - Javascript
body: <p>I have an array of objects called <code>canvasObjects</code>.</p>
  
  <p>Each object has an attribute called <code>z</code>.</p>
  
  <p>I want to sort this array based on objects <code>z</code>. How do I do this using the <code>sort()</code> method?</p>