Repository navigation
NW6| BakhatBegum | CodeAlone-NumberFacts | API-Call Number fact | sprint- 2 - #28
BakhatBegum wants to merge 1 commit into
Conversation
| // } | ||
| // } | ||
| // xhr.send(); | ||
| // }; |
There was a problem hiding this comment.
Great work Bakhat, the point is to keep our codes clean, if you don't use them.
There was a problem hiding this comment.
Thank you very much, @RbAvci but I need the code that is why I commented
There was a problem hiding this comment.
Hey @BakhatBegum I'm not sure why you need that code 👀
As a best practice for clean and maintainable code, remove unnecessary comments and consider alternative methods, such as separate documentation for future plans. You have already implemented the same logic using fetch at the bottom- which is most popular way for web development, so don't confuse yourself with the xhr.
| // } | ||
| // } | ||
| // xhr.send(); | ||
| // }; |
There was a problem hiding this comment.
Hey @BakhatBegum I'm not sure why you need that code 👀
As a best practice for clean and maintainable code, remove unnecessary comments and consider alternative methods, such as separate documentation for future plans. You have already implemented the same logic using fetch at the bottom- which is most popular way for web development, so don't confuse yourself with the xhr.
| <div class="container"> | ||
| <div class="row"> | ||
| <div class="col-md-6 mx-auto"> | ||
| <div class="card bg-primary text-white mt-5 p-5"> |
There was a problem hiding this comment.
I understand that you followed the tutorial. HOWEVER, this is a great example of the importance of semantic HTML and CSS. As you can see, there are several nested div elements but it's not always clear what their purpose is 😕
So, you don't need to change anything here. Just try to see how clean code is important.
| // here is the fetch function | ||
|
|
||
| function getFactFetch(){ | ||
| let number = numberInput.value; |
| const fact = document.querySelector("#fact"); | ||
| let fackText = document.querySelector("#factText"); | ||
|
|
||
| let numberInput = document.querySelector("#numberInput"); |
| @@ -0,0 +1,40 @@ | |||
| const fact = document.querySelector("#fact"); | |||
| let fackText = document.querySelector("#factText"); | |||
There was a problem hiding this comment.
I am not sure if this is going to change, but I would start with const here.
Learners, PR Template
Self checklist
Changelist
Questions
What does the term 'event loop' mean? it is possible for you to provide a video on this topic, or perhaps organize one? Your clarification would be greatly appreciated. Thank you."