René Nyffenegger's collection of things on the web
René Nyffenegger on Oracle - Most wanted - Feedback -
 

constructor [JavaScript snippet]

function A(nm) {
  this.name = nm;
}

function main() {

  var d = new Date()

  var a = new A('an a');

  txt_out("d.constructor: " + d.constructor);
  txt_out("a.constructor: " + a.constructor);
  txt_out("main.constructor: " + main.constructor);

  if (a.constructor == A) {
     txt_out('a.constructor == A');
  }
  else {
     txt_out('a.constructor != A');
  }

  if (d.constructor == A) {
     txt_out('d.constructor == A');
  }
  else {
     txt_out('d.constructor != A');
  }

}