강의

멘토링

커뮤니티

Inflearn Community Q&A

stellee3489's profile image
stellee3489

asked

Bite-Sized React(React.js): From Basics to Practice

2.8) Array Methods 2. Iteration and Searching

콜백지옥 isPositived()와 isPositiveP()

Resolved

Written on

·

259

0

isPositive함수를 주석 처리하고 실행해도 문제 없이 돌아가는데 isPositiveP 함수를 사용할 때는 isPositive 함수가 없어도 되는 건가요? 프로그램이 실행될 때 두 함수의 관계를 잘 모르겠습니다.
javascriptreactnode.js

Answer 1

0

winterlood님의 프로필 이미지
winterlood
Instructor

isPositiveP는 Promise를 사용해 비동기 작업을 수행하고

isPositive는 Promise를 사용하지 않고 비동기 작업을 수행합니다.

둘은 비슷한 작업을 진행하지만 서로 어떠한 의존 관계도 없는 독립적인 관계입니다.

이름만 비슷해요!

마치 아래 두 함수의 관계라고 보시면 됩니다.

function a(){
 console.log("a");
}

function b(){
 console.log("b");
}
stellee님의 프로필 이미지
stellee
Questioner

감사합니다!

stellee3489's profile image
stellee3489

asked

Ask a question