-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[45장] 프로미스 #44
Labels
Comments
Merged
Q.
const project1 = () =>
new Promise(resolve => setTimeout(() => resolve('프로젝트 '), 1000));
const project2 = () =>
new Promise(resolve => setTimeout(() => resolve('너무 '), 500));
const project3 = () =>
new Promise(resolve => setTimeout(() => resolve('고생 많으셨습니다!!'), 1000));
const project4 = () =>
new Promise(resolve => setTimeout(() => resolve('다들 '), 100));
Promise.all([project4(), project1(), project2(), project3()])
.then((arr) => console.log(arr.join('')))
.catch(console.log); 퀴즈 정답
1. 1초
2. 다들 프로젝트 너무 고생 많으셨습니다!! |
Q. 다음은 프로미스의 비동기 처리 상태 정보입니다. 표와 문장의 빈칸을 채워 주세요.
퀴즈 정답
(1) pending
(2) fulfilled
(3) rejected
(4) settled
|
Q. 다음 문제를 읽고 빈 칸을 채우시오.
퀴즈 정답
1. 프로미스 체이닝
2. Promise.race 3. 마이크로태스크 큐 |
Q. 다음 코드의 실행 결과를 써주세요. setTimeout(() => console.log(1), 0)
Promise.resolve()
.then(setTimeout(() => console.log(2), 1000))
.then(setTimeout(() => console.log(3), 500)) 퀴즈 정답1 해설: 따라서 1, 3, 2 순으로 출력된다. |
Q. 다음 코드의 에러가 catch블록에서 캐치 되지 않는 이유를 설명해주세요! try {
setTimeout(() => { trow new Error('에러입니다!')},1000);
} catch (event) {
console.log(event)
} 퀴즈 정답setTimeout 함수의 콜백함수를 호출한 것은 setTimeout 함수가 아니고 에러는 호출자 방향으로 전파되기 때문에 캐치되지 않는다. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
데브코스 4기 프롱이들 모던 JS Deep Dive 책 뿌수기😎
아래 템플릿을 복사해서 1개이상 퀴즈를 만들어주세요. 객관식, 주관식, 단답형 모두 상관없습니다!
The text was updated successfully, but these errors were encountered: