javascript는 오버로딩을 지원하지 않습니다. 예를 들어서, 123456789101112131415161718192021222324252627 New Document function test(content){ alert(content); } function test(){ alert(1); } test("hello my name is.."); Colored by Color Scriptercs 결과는 아래와 같지요. 위에 작성된 function test(content){}는 무시당합니다. 해결하는 방법 solution : 1파라미터 숫자로 구분하는 방법 12345678 function test(){ if(arguments.length === 1){ }else if(arguments.length === ..
[javascript] 간단하게 오버로딩 처리하기!
javascript는 오버로딩을 지원하지 않습니다. 예를 들어서, 123456789101112131415161718192021222324252627 New Document function test(content){ alert(content); } function test(){ alert(1); } test("hello my name is.."); Colored by Color Scriptercs 결과는 아래와 같지요. 위에 작성된 function test(content){}는 무시당합니다. 해결하는 방법 solution : 1파라미터 숫자로 구분하는 방법 12345678 function test(){ if(arguments.length === 1){ }else if(arguments.length === ..
2017.10.24