title: JS "... is not a constructor" mystery
body: <p>I'm confused at this point and I did searched for a solution but couldn't quite find the one answers my situation. Here is the code block I'm having trouble with</p>
  
  <pre><code>this.render = function() {
      this.$el.html(Handlebars.compile($("#home-tpl").html()));
      itemListView = new ItemListView();
      itemListView.setItems(items);
      $('.content', this.$el).html(itemListView.$el);
      return this;
  };
  </code></pre>
  
  <p>It runs flawlessly the first time. But when I navigate back to this from other page </p>
  
  <pre><code>itemListView = new ItemListView();
  </code></pre>
  
  <p>section gives me a "ItemListView is not a constructor" error!
  This is what ItemListView looks like </p>
  
  <pre><code>var ItemListView = function () {
  
    var service = new DataService();
    var items = [];
  
    this.initialize = function() {
        this.$el = $('&lt;div/&gt;');
        this.render();
    };
  
    this.viewAll = function() {
        items = service.viewall();
        this.render();
    }
  
    this.setItems = function(list) {
        items = list;
        this.render();
    }
  
    this.render = function() {
        this.$el.html(Handlebars.compile($("#item-list-tpl").html())(items));
        return this;
    };
  
    this.initialize();
  
    }
  </code></pre>
  
  <p>Now why would it run the first time but not the next time?</p>