728x90 300x250 2024/0124 링크 안에 버튼처리 - 비공개 보호되어 있는 글 입니다. 2024. 1. 29. constructor 객체 constructor는 객체를 생성할 때 호출되는 특별한 메서드이다. 객체의 'constructor'속성은 해당 객체를 생성한 함수를 참조한다. 예를들어, 클래스를 사용한 경우, 'myObject.constructor'는 클래스의 생성자 함수를 가리킨다. class MyClass { constructor() { // ... } } const myObject = new MyClass(); console.log(myObject.constructor); // MyClass 클래스의 생성자 함수를 참조 2024. 1. 28. arguments 이용하여 오버로딩 효과 arguments 객체를 이용해서 매개변수 개수나 타입에 따라 다른 동작을 수행하는 오버로딩 효과를 얻을 수 있다. function performOperation() { if (arguments.length === 1) { console.log("Performing unary operation with", arguments[0]); // 단항 연산 수행 } else if (arguments.length === 2) { console.log("Performing binary operation with", arguments[0], "and", arguments[1]); // 이항 연산 수행 } else { console.log("Unsupported number of arguments"); } } perfo.. 2024. 1. 23. textarea에 포커스에 따라 placeholder 텍스트 지우고 호출하기 스크립트를 이용해서 포커스가 될 경우 placeholder 기능 만들기 Enter your text here... 2024. 1. 22. 이전 1 2 3 4 ··· 6 다음 728x90 반응형