Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[채이] 4-ExchangeRate #20

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

[채이] 4-ExchangeRate #20

wants to merge 5 commits into from

Conversation

chaeiJeon
Copy link
Contributor

No description provided.

Copy link
Contributor

@leehyewon0531 leehyewon0531 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다 ~!!!

setResultValue(currencyOneValue, currencyTwoValue);
}
function setResultValue(currencyOneValue, currencyTwoValue) {
fetch(`https://api.exchangerate-api.com/v4/latest/${currencyOneValue}`)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 👍 👍 배워감니다

Copy link
Contributor

@yoon-junseo yoon-junseo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고하셨습니다.

currencyTwoValue = temp;
setResultValue(currencyOneValue, currencyTwoValue);
}
function setResultValue(currencyOneValue, currencyTwoValue) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

callback도 있고, async await으로 할 수도 있을 거 같아요

}
function setResultValue(currencyOneValue, currencyTwoValue) {
fetch(`https://api.exchangerate-api.com/v4/latest/${currencyOneValue}`)
.then((rest) => rest.json())
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rest라고 작성 되어 있는데 res에 대한 오타인지 아니면 일부러 rest로 했는지 궁금해요

const $swap = document.querySelector("#swap");
const $rate = document.querySelector("#rate");

$amountOne.addEventListener("change", changeAmountOne);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이벤트 리스너를 개인적으로 선언된 함수 아래에 적는게 나을 것 같다고 생각해요!
함수 선언식으로 작성해서 함수들이 호이스팅 되어서 사용 가능한 부분이라서 지금처럼 작성하면 상관 없지만
그래도 함수 선언부 아래에서 호출하는게 나을 것 같다는 개인적인 생각입니다!

https://joshua1988.github.io/web-development/javascript/function-expressions-vs-declarations/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants