function Parent(){}
Parent.prototype.Show = function()
{
console.log( "Parent Show" ); // Parent Show 상속해서 사용
}
function A(){}
A.prototype = new Parent();
function B(){}
B.prototype = new Parent();
function C(){}
C.prototype = new Parent();
C.prototype.Show = function()
{
console.log( "C Show" ); // C 에서 Show 함수 캐치
}
var a = new A();
a.Show();
var b = new B();
b.Show();
var c = new C();
c.Show();
'frontend > Java Script' 카테고리의 다른 글
2. 함수형 프로그래밍 - map (0) | 2019.03.14 |
---|---|
1. 함수형 프로그래밍 - Filter (0) | 2019.03.14 |
Video Tag Event (0) | 2017.10.30 |
IE10 .val() 값 초기화 문제 (0) | 2017.10.30 |
모바일 위 아래 드래그 막기 (0) | 2017.10.30 |