Клиентский JavaScript. Справочник

         

Примеры


Создаётся прототип Tree и объект этого типа - theTree. Затем выводится свойство constructor объекта theTree.

function Tree(name) {
this.name=name
}
theTree = new Tree("Redwood")
document.writeln("<B>theTree.constructor is</B> " +
   theTree.constructor + "<P>")

На выходе будет:

theTree.constructor is function Tree(name) { this.name = name; }



Содержание раздела