Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q794 How can I pass the name of an instance of an object to the object itself?

You are here: irt.org | FAQ | JavaScript | Object | Q794 [ previous next ]

Pass the name of the instance as a parameter:

<SCRIPT LANGUAGE="JavaScript"><!--
functionmyObject (number,string,name) {
    this.number = number;
    this.string = string;
    this.name = name;
}

X = new myObject(1,'x',"X");
//--></SCRIPT>

©2018 Martin Webb