NW6| Fikret Ellek | [TECH ED] JavaScript Challenges | Week-3#13
NW6| Fikret Ellek | [TECH ED] JavaScript Challenges | Week-3#13fikretellek wants to merge 2 commits intoCodeYourFuture:masterfrom
Conversation
musayuksel
left a comment
There was a problem hiding this comment.
Overall, great job @fikretellek ! I just wanted to add two things to what I mentioned earlier:
-
During development, it's fine to keep all the
console.log()statements for debugging purposes. However, before submitting yourpull request (PR), it's good practice to delete them. In the future, you will be using different tools to provide warnings about this kind of statements such asESlint. -
You placed all the JS code here because of the
<!-- JS goes here -->line. Normally, you can put the<script>tags and links there, and create a separate script file to contain all your logic.
Once again, great work overall! These suggestions just for further improvement on your code. Keep it up!
|
|
||
| function generateThumbs(photos) { | ||
| thumbCont.innerHTML = ""; | ||
| photos.map((photo) => { |
There was a problem hiding this comment.
This is a little tricky. If you don't need to return data from your loop, you can use forEach instead of map. Use map when you want to do some calculation and return data.
| figure.innerHTML = ""; | ||
| //there is already css rule about this document.querySelectorAll(".thumb").forEach((element) => (element.style.border = "0px")); | ||
| const mainImg = document.createElement("img"); | ||
| mainImg.src = links[selectedImgId] ?? Object.values(links)[0]; |
There was a problem hiding this comment.
Great job using the nullish-?? operator here! Well done
| const apiKey = "2d2afc913f90548905b086803a05ef5d"; | ||
| const accessKey = "m89STg41g63uXj4rt_9u5GXtN9LTGDH_ViVVX9Sy9Yc"; |
There was a problem hiding this comment.
Currently, we are storing keys in the codebase which is not secure as you can imagine. We will learn to store them somewhere else in the future. Please remember this. No need to any action for now- just info :)
No description provided.