Object

From PlainOldWebserver

Jump to: navigation, search

This is the basis of all other objects. This is the best choice for associative arrays.

 var obj = new Object();
 obj.a = 5;
 obj.run_me = function() {
   document.writeln("I am run");
   document.writeln("a is "+this.a);
 }
 obj.run_me();


Result:

 I am run
 a is 5
Personal tools
Navigation