자바스크립트(115)
-
포워딩(Forwarding) 방법 정리
포워딩(Forwarding) 방법 정리 · HTML 포워딩 방법 · JavaScript 포워딩 방법 · JSP 포워딩 ---------------------------------------- HTML 포워딩 방법 JavaScript 포워딩 방법 2
-
모던 JavaScript 튜토리얼
모던 JavaScript 튜토리얼 https://ko.javascript.info/
-
13.html-은닉화 / 캡슐화
은닉화 / 캡슐화 소스 코드 function Rectangle(width, height){ //지역변수는 외부에서 호출 불가(은닉화) var width = width; var height = height; this.getWidth = function(){ return width; }; this.getHeight = function(){ return height; }; } var rectangle = new Rectangle(6, 8); //외부에서 호출불가 document.write(rectangle.width + ', ' + rectangle.height + ' '); //메소드를 통해 접근 document.write(rectangle.getWidth() + ', ' + rectangle.getHeig..
-
은닉화 / 캡슐화- 12.html
은닉화 / 캡슐화 소스 코드 function Rectangle(width, height){ //지역변수는 외부에서 호출 불가(은닉화) var width = width; var height = height; this.getWidth = function(){ return width; }; this.getHeight = function(){ return height; }; this.setWidth = function(width){ //검증 if(width
-
프로토타입을 사용한 메소드 생성- 11.html
프로토타입을 사용한 메소드 생성 학습내용 (중요)프로토타입은 생성자 함수를 사용해 생성된 객체가 공통으로 가지는 공간 prototype영역 호출 메모리 영역의 효율성 증가 상속에서도 동일한 개념이 나옴 소스 코드 function Student(name, korean, math, english, science){ this.name = name; this.korean = korean; this.math = math; this.english = english; this.science = science; } //프로토타입은 생성자 함수를 사용해 생성된 객체가 공통으로 가지는 공간 //prototype영역 호출 //메모리 영역의 효율성 증가 Student.prototype.getSum = function(){ r..
-
prototype 확인- 21.html
prototype 확인 객체 리터럴 방식으로 생성된 객체는 Object.prototype 객체가 프로토타입 객체가 된다는 것을 확인 할 수 있습니다. 소스 코드 var student = { name: 'student', age: 30 }; console.log(student.toString()); console.dir(student); 출력결과 크롬 브라우저의 출력결과 Object age: 30 name: "student" __proto__: Object __defineGetter__: function __defineGetter__() { [native code] } __defineSetter__: function __defineSetter__() { [native code] } __lookupGette..