title: Javascript my Object is disappearing
body: <p>My object newHomes is removed at some point when the code is ran. It can not be called from the browser console. My <code>console.log</code> inside the code does return values.</p>
  
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>$(() =&gt; {
      console.log($('#zillowLink').attr('href'))
      console.log("js is running");
      $('#addHome').removeClass('btn-danger').addClass('btn-success');
      $('h1').addClass('text-center');
  
      var newHomes = [
          {address: "27569 Cedarwood Drive", sf: "2,535", bedrooms: 3, baths: 2.5, price: "$496,500"},
          {address: "316 Annandale Drive", sf: "1,326", bedrooms: 4, baths: 2, price: "$275,000"},
          {address: "251 Grandview Road", sf: "3,800", bedrooms: 3, baths: 2, price: "$699,900"},
          {address: "28571 Manitoba", sf: "2,960", bedrooms: 4, baths: 3.5, price: "$775,000"}
      ];
      console.log(newHomes);
  
      var cells = $('#homes thead tr').children();
      cells.eq(0).css('color', 'blue');
      cells.eq(4).css('color', 'green');
  
      console.log(newHomes);
      const newLink = $( '&lt;br&gt;&lt;br&gt;&lt;a id="zillowLink" href="http://www.zillow.com"&gt;Visit Zillow.com&lt;a&gt;' );
      newLink.appendTo('body');
  
      console.log(newHomes);
      const addNewHome = ($event) =&gt; {
          var counter = 0;
          $($event.currentTarget).appendTo(newHomes["counter"])
      }
      console.log(newHomes);
      $('#zillowLink').attr( "target", "_blank" ); //_blank opens new Tab
      $('#addHome').on('click', 'tr', addNewHome);
      const removeHome = ($event) =&gt; {
          $($event.currentTarget).fadeOut(
              500, ()=&gt;{
                  this.remove
              });
      }
      console.log(newHomes);
      $('#homes tbody').on('click', 'tr', removeHome);
  
      console.log(newHomes);
     
  
  
  });</code></pre>
  <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"&gt;&lt;/script&gt;
  &lt;!DOCTYPE html&gt;
  &lt;html lang="en"&gt;
      &lt;head&gt;
          &lt;meta charset="UTF-8"&gt;
          &lt;title&gt;Welcome Back to jQuery&lt;/title&gt;
          &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css"&gt;
      &lt;/head&gt;
      
      &lt;body class="container"&gt;
  
      &lt;h1 class="jumbotron"&gt;Lake Arrowhead Homes For Sale&lt;/h1&gt;
  
      &lt;table id="homes" class="table"&gt;
          &lt;thead&gt;
              &lt;tr&gt;
                  &lt;th&gt;Address&lt;/th&gt;
                  &lt;th&gt;Sq. Ft.&lt;/th&gt;
                  &lt;th&gt;Bedrooms&lt;/th&gt;
                  &lt;th&gt;Baths&lt;/th&gt;
                  &lt;th&gt;Price&lt;/th&gt;
                  &lt;th&gt;&lt;/th&gt;
              &lt;/tr&gt;
          &lt;/thead&gt;
          &lt;tbody&gt;
              &lt;tr&gt;
                  &lt;td&gt;27374 Matterhorn Drive&lt;/td&gt;
                  &lt;td&gt;1,664&lt;/td&gt;
                  &lt;td&gt;3&lt;/td&gt;
                  &lt;td&gt;2&lt;/td&gt;
                  &lt;td&gt;$279,500&lt;/td&gt;
                  &lt;td&gt;&lt;button class="btn btn-xs btn-danger"&gt;Remove&lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;243 El Dorado&lt;/td&gt;
                  &lt;td&gt;4,900&lt;/td&gt;
                  &lt;td&gt;6&lt;/td&gt;
                  &lt;td&gt;6.5&lt;/td&gt;
                  &lt;td&gt;$990,000&lt;/td&gt;
                  &lt;td&gt;&lt;button class="btn btn-xs btn-danger"&gt;Remove&lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td&gt;1228 Klondike Drive&lt;/td&gt;
                  &lt;td&gt;2,158&lt;/td&gt;
                  &lt;td&gt;4&lt;/td&gt;
                  &lt;td&gt;2.5&lt;/td&gt;
                  &lt;td&gt;$400,000&lt;/td&gt;
                  &lt;td&gt;&lt;button class="btn btn-xs btn-danger"&gt;Remove&lt;/button&gt;&lt;/td&gt;
              &lt;/tr&gt;
          &lt;/tbody&gt;
      &lt;/table&gt;
      &lt;br&gt;
      &lt;button id="addHome" class="btn btn-danger"&gt;Add Home&lt;/button&gt;
  
      &lt;script src="https://code.jquery.com/jquery-3.1.1.min.js"&gt;&lt;/script&gt;
      &lt;script src="js/app.js"&gt;&lt;/script&gt;
  
  
      &lt;/body&gt;
  &lt;/html&gt;</code></pre>
  </div>
  </div>
  </p>