Omirion Posted January 15, 2011 Share Posted January 15, 2011 Hey guys an example. var obj = { string:'aa', func:function(){ var st = this.string //do stuff with st } } Quote Link to comment Share on other sites More sharing options...
.josh Posted January 15, 2011 Share Posted January 15, 2011 well it depends... if you just use string then it is accessible to other methods within your object. What you are doing there is creating a copy that is local and accessible only to that specific function. IOW it is a question/matter of variable scope requirements. Quote Link to comment Share on other sites More sharing options...
Omirion Posted January 15, 2011 Author Share Posted January 15, 2011 kk thanks for the heads up. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.