일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
- 동적쿼리
- egov
- react
- c:forEach
- Spring
- MySQL
- Java
- 쿼리
- jQuery
- MVC
- HTTP
- C#크롤링
- iBATIS
- 콜백
- SQL
- 국제화
- RequestMethod.POST
- mybatis
- 서드파티모듈
- AndroidStudio
- fullcalendar
- vscode
- JSTL
- node.js
- JavaScript
- c:choose
- android
- jsx
- Callback
- NPM
- Today
- Total
목록Callback (2)
Today Yewon Learned
이벤트에 여러정보 전달하기 const EventEmitter = require('events'); const myEmitter = new EventEmitter(); myEmitter.on('test', (arg1, arg2, arg3) => { console.log(arg1); console.log(arg2); console.log(arg3); }); myEmitter.emit('test', 'apple', 'banana', 'pear'); 결과) apple banana pear 콜백에서 받고 싶은 인자만 설정하기 const EventEmitter = require('events'); const myEmitter = new EventEmitter(); myEmitter.on('test', (arg1, ..
동기 실행 방식 예시) const fs = require('fs'); console.log('Start'); let content = fs.readFileSync('./new', 'utf8'); // 동기 실행 부분 console.log(content); console.log('Finish'); 출력 결과) Start Hello Node.js! Finish - readFileSync 함수 : 동기 실행 함수 비동기 실행 방식 (Node.js 권장) - 특정 작업이 완료되었을 때 실행할 콜백을 등록해두고, 바로 다음 코드로 실행을 넘기는 것 예시) console.log('Start'); fs.readFile('./new', 'uft8', (error, data) => { // 비동기 실행 부분 consol..