Skip to content

NW6| Fikret Ellek | [TECH ED] JavaScript Challenges | Week-3#13

Open
fikretellek wants to merge 2 commits intoCodeYourFuture:masterfrom
fikretellek:master
Open

NW6| Fikret Ellek | [TECH ED] JavaScript Challenges | Week-3#13
fikretellek wants to merge 2 commits intoCodeYourFuture:masterfrom
fikretellek:master

Conversation

@fikretellek
Copy link
Copy Markdown

No description provided.

@fikretellek
Copy link
Copy Markdown
Author

Copy link
Copy Markdown

@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) => {
Copy link
Copy Markdown

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];
Copy link
Copy Markdown

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";
Copy link
Copy Markdown

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.

2 participants