• 카테고리

    질문 & 답변
  • 세부 분야

    풀스택

  • 해결 여부

    미해결

안녕하세요 강사님 질문이있습니다.

22.02.07 23:16 작성 조회수 78

0

fs.writeFile('./writeme.txt', '써보자123')
.then(()=> console.log('성공'))
.then(()=>{return  fs.readFile('./writeme.txt') })
.then((data)=>{console.log(data.toString()); return data.toString()})
.then((data)=>console.log("테스트2",data))
.catch((err)=> console.error(err));
 
Promise .then .catch 문에서 3번쨰줄처럼 return 을 해준것은
다음 then 문에서만 인자로 받을수 있는게 맞는것인가요?

답변 1

답변을 작성해보세요.

0

네 다음 then에서만 매개변수로 받을 수 있습니다.