← 문제 목록
중급 JavaScript 50P

프라미스 체이닝의 이해

다음 코드를 살펴보세요:



위 코드는 비동기 함수를 사용하여 두 개의 `.then()` 체이닝을 보여줍니다. `asyncFunction`이 반환하는 값은 무엇인가요?
JAVASCRIPT
function asyncFunction() {
    return new Promise((resolve) => {
        setTimeout(() => {
            resolve('성공');
        }, 1000);
    });
}

asyncFunction()
    .then((result) => {
        console.log(result);
        return '다음 단계';
    })
    .then((nextResult) => {
        console.log(nextResult);
    });

답변

로그인 후 제출하기
0명 풀이 · 정답률 0%