본문 바로가기
728x90
반응형

IT/JavaScript와 Framework109

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.
자바스크립트 디버깅 시간날때 한번 읽어봐라. https://subicura.com/2018/02/14/javascript-debugging.html 크롬 개발자 도구를 이용한 자바스크립트 디버깅 자바스크립트 디버깅 어떻게 하시나요? alert()을 사용하시나요? 아니면 console.log()를 선호하시나요? 크롬 개발자 도구는 일반적으로 알고 있는 것보다 더 강력한 기능을 제공합니다. 많은 개발자 subicura.com 2022. 9. 28.
Promise, Code Runner 비동기 작업을 편하게 작업 - 이전 : 콜백함수로 처리...콜백이 많아지면, 코드가 난잡해짐 개발툴 : Visual Studio Code 추천 플러그인 : Code Runner 사용법 : 소스 파일에서 오른쪽 버튼 누르고...Run Code 선택 function increaseAndPrint(n, callback) { setTimeout(() => { const increase = n + 1; console.log(increase); if (callback) { callback(increase); } }, 1000) } increaseAndPrint(0, n => { increaseAndPrint(n, n => { increaseAndPrint(n, n => { increaseAndPrint(n, n =.. 2022. 9. 20.
728x90
반응형