Skip to main content
GameDev.net gamedev.net
๐Ÿ”’ Locked

[web] Prototype

Started by OleKaiwalker Sep 26, 2006 at 4:48 AM 0 replies 500+ views
Original Post
OleKaiwalker
OleKaiwalker
Hey, Is there any reasonable explanation to why this piece of &#106avascript is not interpreted? function node(i,p){ this.i; this.p; return this; }; node.prototype.something=function(){ alert(this.i); alert(this.p); }; The prototype is able to acces i but not p. Why is that and is there any solution to it?
markr
markr
Quote:

this.i;this.p;



Neither of these two statements does anything whatsoever.

Did you mean

this.i = i;this.p = p;


?

I imagine that would work better.

Mark

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.