title: Updating a Javascript Class properties
body: <pre><code>var myProp = function() {
    this.name = name;
    this.gender = gender;
    this.age = age;
  }
  </code></pre>
  
  <p>So I have JS class with a bunch of properties. That look like that above.</p>
  
  <pre><code>$('#nav li').on('click', function() {
    var selected_li = $(this);
  
    function getProp() {
      myProp = function() {
        return this.name + 'John' + this.gender + 'Male' + this.age + 'Nine'; 
      }
    }
  });
  </code></pre>
  
  <p><code>console.log(myProp);</code></p>
  
  <p><code>onClick</code> of my element, i'm trying to update the properties within myProp so if I do <code>console.log()</code> i'll get <code>name = 'John'</code>, <code>gender = 'male'</code> and so on.</p>
  
  <p>Is it something to do with the scope why I cannot update my properties of <code>myProp</code>?</p>
  
  <p>Whenever I console log <code>myProp</code> I just get back myProp, exactly how it is without any properties being updated?</p>
  
  <p>Still learning, apologies if this seems stupid.
  Thanks.</p>