스크립트(17)
-
AutoHotkey 오토핫키
AutoHotkey 오토핫키 반복작업을 자동으로 할 수 있도록 매크로를 만들어서 사용할 수 있는 오픈 소스 프로그램입니다. 운영체제 단축키 지정에 특화된 스크립트 언어입니다. 간단하게 반복작업을 줄이기 위한 매크로 제작도구로 유용하게 사용할 수 있습니다. https://bit.ly/2Ue4OWI https://en.wikipedia.org/wiki/AutoHotkey https://namu.wiki/w/AutoHotKey https://www.autohotkey.com https://github.com/Lexikos/AutoHotkey_L
-
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..
-
배열에 객체 저장- 10.html
배열에 객체 저장 학습내용 자바와 유사 동일한 패턴 사용시 소스 코드 //생성자 함수 function Student(name, korean, math, english, science){ //속성 지정 //this 전역변수로 this없으면 지역변수 this.name = name; this.korean = korean; this.math = math; this.english = english; this.science = science; //메소드 지정 this.getSum = function(){ return this.korean + this.math + this.english + this.science; }; this.getAverage = function(){ return this.getSum()/4; ..