oop - access local variable outside javascript -
how can access name variable inside outside.
function myobject(){ var name="test" } var n=new myobject(); alert(n.name);
i want alert here.
please guide me.
since creating instance of myobject
function, need add name
it's property access outside.
function myobject(){ this.name="test" } var n=new myobject(); alert(n.name);
Comments
Post a Comment