Why is my prototype function not returning the property of the instance?
<p>I have a simple object in Javascript.</p>

<blockquote>
  <p>function myClass(x,y) {</p>

<pre><code>this.x = x;

this.y = y;
</code></pre>
  
  <p>}</p>
</blockquote>

<p>and a prototype function</p>

<blockquote>
  <p>myClass.prototype.myfunction = function() {</p>
  
  <p>console.log(this.x);</p>
  
  <p>}</p>
</blockquote>

<p>and in my main script, </p>

<blockquote>
  <p>var x = 2; var y = 4;</p>
  
  <p>myinstance = new myClass(x,y);</p>
  
  <p>myinstance.myfunction();</p>
</blockquote>

<p>Instead of receiving x, I get undefined instead. Why is that? </p>
