title: Using Array Map in a Javascript "Class" to Return Each Item of the Array
body: <p>I'm trying to build some programs for fun and learning. I have the problem below: </p>
  
  <pre><code>function Hero(name) {
  this.name = name;
  
  this.addItem = function(item) {
      this.items = this.items || [];
      this.items.push(item);
  };
  
  // .... 
  
  this.viewItinerary = function() {
      this.items.map(function(currItem){
          return currItem;
      });
  };
  
  }
  
  var alex = new Hero("Alex");
  alex.addItem("Sword");
  alex.addItem("Shield");
  console.log(alex.viewItinerary());
  // returns undefined. why does it not return items in array?
  </code></pre>
  
  <p>If I replace the return statement with a console.log(currItem) it works. So why is my code returning undefined? Any ideas?</p>
  
  <p>Thanks</p>