-
-
Notifications
You must be signed in to change notification settings - Fork 41
NW6| Fikret Ellek | [TECH ED] JavaScript Challenges | Week-3 #13
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
base: master
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.
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 reques
t (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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great job using the nullish-??
operator here! Well done
const apiKey = "2d2afc913f90548905b086803a05ef5d"; | ||
const accessKey = "m89STg41g63uXj4rt_9u5GXtN9LTGDH_ViVVX9Sy9Yc"; |
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.
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.