title: Uncaught TypeError: Cannot read property 'item_name' of undefined
body: <p>I'm trying to get rid of this error my friend and I have been having issues with. The error is in the title and happens at line 93... any ideas or suggestions? Line 93 is marked with a comment below. <code>document.body.innerHTML.replace("__ITEM__", pocket.item_name); //LINE 93</code></p>
  
  <p>Another thing I'd like to mention is that I've cropped out all unnecessary code (I think) so please do ask if you need another section.</p>
  
  <p>I won't be surprised if this is some newbie mistake, so feel free to call me out on it. I also apologise for any bad practices or such you may find, I am still new to this.</p>
  
  <p>The function <strong>start()</strong> is called first.</p>
  
  <pre><code>var status, items_none, items, pocket, money;
  
  function item(item_name, usage_id, description, minimum_cost) {
      this.item_name = item_name;
      this.usage_id = usage_id;
      this.description = description;
      this.worth = minimum_cost;
      this.usage_verb = "Use";
      this.choose_number = false;
  }    
  function start() {
      status = "Welcome to Collector.";
  
      items_none = item("---", -2, "Your pockets are empty.", 0);
      items = new Array();
      items[0] = item("Cardboard Box", 0, "Open the box to see what's inside.", 100);
      ...
  
      pocket = items_none; //Start with empty pockets.
      money = 100; //Start with 0 coins.
  
      updateGui();
  }
  function updateGui() {
      //This updates all text on the page.
      document.body.innerHTML.replace("__COINS__", money);
      document.body.innerHTML.replace("__ITEM__", pocket.item_name); //LINE 93
      document.body.innerHTML.replace("__STATUS__", status);
      document.body.innerHTML.replace("__ITEM:USE__", pocket.usage_verb);
      document.body.innerHTML.replace("__ITEM:DESC__", pocket.description);
      document.body.innerHTML.replace("__ITEM:WORTH__", pocket.worth);
      document.body.innerHTML.replace("__ITEM:VERB__", pocket.usage_verb);
  }
  </code></pre>
  
  <p>Like always, thanks in advance and happy coding!</p>