Skip to content

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

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

fikretellek
Copy link

No description provided.

@fikretellek
Copy link
Author

Copy link

@musayuksel musayuksel left a 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:

  1. During development, it's fine to keep all the console.log() statements for debugging purposes. However, before submitting your pull 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 as ESlint.

  2. 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) => {

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];

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

Comment on lines +48 to +49
const apiKey = "2d2afc913f90548905b086803a05ef5d";
const accessKey = "m89STg41g63uXj4rt_9u5GXtN9LTGDH_ViVVX9Sy9Yc";

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 :)

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.

None yet

2 participants