퀴즈 · 3 questions
⚡ Async & Promises — 타입 붙은 동시성
Promise<T>, async/await, async iterable, Promise.all, error handling
Level 0Curious
0 XP0/93 lessons0/23 achievements
0/100 XP to next level100 XP to go0% complete
Quiz
01
async function foo(): string 의 return type?Hint
Annotation 없는 async 함수 hover — TS 가 너가 return 하는 거 기반으로 Promise 추론.
02타입 레벨에서
Promise.all([p1, p2]) 가 뭐 반환?Hint
Destructure:
const [a, b] = await Promise.all([fetchA(), fetchB()]). a 와 b 가 구별, 옳게 추론된 타입.03
try { ... } catch (e) { ... } 의 e 타입?Hint
한 분기에
throw 'oops', 다른 분기에 throw new Error('oops') 시도. 둘 다 catch 도달, 근데 e 가 둘 중 하나일 수.댓글 0
🔔 답글 알림 (로그인 필요)로그인 — 댓글을 남기려면 로그인해 주세요.
아직 댓글이 없어요. 첫 댓글을 남겨보세요.