cachaito
1/23/2014 - 10:22 PM

Pole constructor i "tworzenie" obiektów z jego pomocą nowych objektów

var Obj = function Obj(name, surname, age) {
  this.name = name,
  this.surname = surname,
  this.age = age
}

var obj1 = new Obj('Józek', 'Kowalski', 19);

obj1.constructor //wskazuje na function Obj

var obj2 = new obj1.constructor('Marcin', 'Dziędziel', 34);