Skip to content
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

BER Webdev PT 012024 Nil Erden #2997

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

Conversation

nil-e
Copy link

@nil-e nil-e commented Mar 22, 2024

When I tried doing the lab I found out that the PunkAPI is down and it will be decommissioned soon as well. So I used another api to get product data. So i am not really displaying beers but it should follow the same logic.

@nil-e nil-e changed the title Almost done - wip BER Webdev PT 012024 Nil Erden Mar 26, 2024
return productData;
})
.then(() => {
for (let i = 0; i < 25; i++) {

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. avoid for loop with let i =0 sync, here you have define the length everytime. (use better available options .forEach, for(const each of array)

}
return itemNames;
})
.then(() => res.render('beers', { itemNames }))

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

when you returning in previous .then() you can just receive it as parameter, there is no need of using itemNames variable to store it (unless needed) [Promise Chaining]

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