-
Notifications
You must be signed in to change notification settings - Fork 2
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this 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}`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 👍 👍 배워감니다
There was a problem hiding this 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) { |
There was a problem hiding this comment.
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()) |
There was a problem hiding this comment.
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); |
There was a problem hiding this comment.
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/
No description provided.