Created
May 3, 2018 13:36
-
-
Save khg0712/353df6e7ce0961d5ee73f1be9b68ca76 to your computer and use it in GitHub Desktop.
생성자 함수 예시
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function a(){ | |
this.a = 1; | |
this.b = 2; | |
}//함수 리터럴로 생성자 함수 생성 | |
var b = new a();//생성자를 통한 객체 생성 | |
console.log(b.a);//1 출력 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment