function Person(name, age) { this.name = name; this.age = age; this.sayName = function() { document.write(this.name); } } // new 연산자로 새 객체를 만듭니다. var person1 = new Person("nam", 33); var person2 = new Person("sin", 27); person1.sayName(); // nam document.write("<br>"); person2.sayName(); // sin document.write("<br>"); // person1 객체는 Person 객체의 인스턴스 입니다. document.write(person1 instanceof Person); // true document.write("<br>"); // person2 객체의 생성자 함수는 Person 입니다. document.write(person2.constructor == Person); // true