강의

멘토링

커뮤니티

Inflearn Community Q&A

winhsh913078's profile image
winhsh913078

asked

NodeJS API Server Built with Test-Driven Development (TDD)

Database and update controller linking

promise 가 넘어올 때 .then 사용법 문의

Written on

·

269

0

코딩하는 중

user.save()
          .then(_=>{
            res.json(user);
          })
 
이렇게 작성되는데, _=> 이것의 의미는 무엇일까요?
expresstddnodejsrest-api

Answer 1

0

jeonghwan님의 프로필 이미지
jeonghwan
Instructor

_ 는 then 함수에 전달한 콜백함수의 인자 이름인데요.프로그래밍 관례상 사용하지 않겠다는 의미의 변수명입니다. then(()=> {...}) 이렇게 사용하셔도 됩니다.

winhsh913078's profile image
winhsh913078

asked

Ask a question