title: Construct an array of elements from an array of objects?
body: <p>With a data structure that looks like this:</p>
  
  <pre><code>Items : [
      {
          title : 'One',
          value : 1,
      },
      {
          title : 'Two',
          value : 2,
      }
  ]
  </code></pre>
  
  <p>How would I construct an array of the titles from Items? As in ['One', 'Two']</p>
  
  <p>This codeset generates a 'SyntaxError: Unexpected identifier' if <strong>titles</strong> == [] {..</p>
  
  <pre><code>app.get('/', function(req, res){
      var titles = [];
      for (var i=0, length=Items.length; i &lt; length; i++) {
          if titles == [] {
              titles += Items[i]['title'];
          }
          else {
              titles = titles + ', ' + Items[i]['title'];
          }
          console.log(titles);
      };
    res.render('items', {
      itemTitles: titles
    });
  });
  </code></pre>