[JavaScript] 프로토타입(Prototype)
프로토타입(ProtoType) - 객체의 기본적인 속성을 정의합니다. - function() 구문을 통해 만든 클래스라는 객체 정의로부터만 생성 할 수 있습니다. - 자바스크립트는 포토타입 기반 프로그래밍 언어입니다. 123456789101112131415161718192021222324252627Insert title here //프로토타입 객체 => JAVA의 클래스와 같은 개념 function Person(name, age) { this.name = name; this.age = age; } Person.prototype.walk = function(speed) { console.log("%s가 %d의 속도로 걸어가.", this.name, speed); } //객체를 참조하여 함수 추가 var p..