728x90 반응형 IT/JavaScript와 Framework99 javascript 클래스 예제 2022. 10. 13. javascript 비구조화 할당(destructuring assginment) 2022. 10. 13. javascript-sample-001-기능 Hello, World! 출처: https://developer.chrome.com/docs/devtools/console/?hl=ko 2022. 10. 6. 자바스크립트에서 ... 의미 일반적으로 객체 변수를, 다른 객체 변수에 복사하면 주소값이 복사되지만, ... 이라는 연산자를 이용하여 객체에 속한 값만 들고 오게 할때 사용된다. let tempMovingItem; const movingItem = { type: "tree", direction: 0, top: 0, // 위,아래 정보 left: 0, // 좌,우 정보 }; function init() { tempMovingItem = {...movingItem}; tempMovingItem.top = 4; console.log(movingItem); for (let i = 0; i < GAME_ROWS; i++) { prependNewLine(); } } 위 예제는 tempMovingItem 의 각 멤버변수에 movingItem 의.. 2022. 10. 4. 이전 1 ··· 3 4 5 6 7 8 9 ··· 25 다음 728x90 반응형